Hey guys, I'm in the process of learning C (again, kind of) and I'm confused as to why the following method prints "Howdy" to the console rather than "Woah."
Also, I receive the following warnings. What am I doing wrong?
Code:
void pointer(int * a) {
a = "Woah\n";
}
main() {
char *string = "Howdy\n";
pointer(string);
printf("%s", string);
}
Also, I receive the following warnings. What am I doing wrong?
Code:
Craigs-iMac:Homework 1 Craig$ gcc test.c
test.c: In function pointer:
test.c:4: warning: assignment from incompatible pointer type
test.c: In function main:
test.c:10: warning: passing argument 1 of pointer from incompatible pointer type
Craigs-iMac:Homework 1 Craig$