|
||||||
| Forums FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| ARCHIVES - Programming & Scripting A place to discuss website design, programming, shell scripts, etc |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
#include <stdio.h>
void strcp(char *,char *); int main(){ char *s = "i am working"; char *t; strcp(t,s); printf("%s", t); return 0; } void strcp(char *s, char *t){ while(*s++ = *t++); } /*This was my code. i compiled it and tried to execute it. but then it says Segmentation fault Any ideas on what is causing this trouble. Thanks.*/ |
|
|||
|
Your destination pointer t is not pointing to any storage area.
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|