All pastes #424542 Raw Edit

Untitled

public text v1 · immutable
·published 2007-04-04 21:12 UTC
rendered paste body
bash-3.00# gcc -o endianess endianess.cpp
Undefined                       first referenced
 symbol                             in file
__gxx_personality_v0                /var/tmp//cc8i3K7j.o
ld: fatal: Symbol referencing errors. No output written to endianess
collect2: ld returned 1 exit status
bash-3.00#

bash-3.00# cat endianess.cpp
#include <stdio.h>


int main() {
  int flagVal = 0X01020304;
  char *cptr = (char *)&flagVal;

  for (int i = 0; i < 4; i++) {
    printf("Val is %d\n", *cptr);
    *cptr++;
  }

  return 0;
}
bash-3.00#