I get an odd output when I run a program I wrote. This program is just a basic pointer excersize that I thought up.
Code:
#include <stdio.h>
#include <string.h>
int main(int argc, char** argv)
{
char** buffarray;
char b[20] = "hello world";
buffarray[0] = b;
printf("%s\n", buffarray[0]);
return 0;
}
this is the output
thomas@skringla:~/projects$ ./test
hello world
6554:
6554: runtime linker statistics:
6554: final number of relocations: 84
6554: final number of relocations from cache: 3
thomas@skringla:~/projects$
when compliled there isn't even a warning.
my compliler version in case that helps
Code:
thomas@skringla:~/projects$ gcc -v
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.2 --program-suffix=-4.2 --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.2.4 (Ubuntu 4.2.4-1ubuntu3)