Go Back   openSUSE Forums > Archives > SF Archives > ARCHIVES - Programming & Scripting
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
  #1 (permalink)  
Old 18-Feb-2008, 08:37
Amitav
Guest
 
Posts: n/a
Default

#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.*/
  #2 (permalink)  
Old 18-Feb-2008, 08:45
ken_yap
Guest
 
Posts: n/a
Default

Your destination pointer t is not pointing to any storage area.
  #3 (permalink)  
Old 18-Feb-2008, 08:57
Amitav
Guest
 
Posts: n/a
Default

Quote:
Your destination pointer t is not pointing to any storage area.
[/b]
Thank you.
 

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




 

Search Engine Friendly URLs by vBSEO 3.3.0 RC2