I'm having some trouble with pointers and arrays, here's my code:
Code:
/*------------------------\
| I HATE POINTERS ARRGGGG |
|This program serves no |
|purpose except so I can |
|be told what is wrong |
|with it, because I cant |
|figure out these damn |
|pointers! |
|Brian - 2002 |
\------------------------*/
#include <stdio.h>
#include <string.h>
int changeToHello(char *thingToChange[BUFSIZ])
{
strcpy(*thingToChange,"hello");
return 0;
}
int main(void)
{
char myString[] = "I like to read books";
printf("\n%s",myString);
changeToHello(&myString);
printf("\n%s\n",myString);
return 0;
}
You can see what it's supposed to do, but how do I fix it? Help is appriciated, Bri.