Your problem lies in setting a string to a pointer to a string. Because s has no defined size, the program will seg fault. If you want to do this, s needs to be char s[100] as well.
You can do this in functions:
void copyString (char c[100], char *s)
{
strcpy (s, c);
}
As long as the length for s was predefined where this function is being called.
Hope this helps,
Mistro116
|