LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-06-2004, 04:31 AM   #1
pantera
Member
 
Registered: May 2004
Posts: 80

Rep: Reputation: 15
return statement in functions


i have the following codes:
the problem with me is that when i call readFile function...it checks for some if statement and calls notexist function ......after the notexist function completes its operation it does not return to readFile function and print "back here"....can anyone suggest my mistake

i am using C in linux

int main(int argc, char *argv[]) {
....
....
....
if (strcmp(msg,lm)==0)
{
readFile(w);
}
}
return 0;
}


notexist(char *me)
{
....
....
....
return(1) ;
}

void readFile(char *file)
{
....
....
....
if ( )
{
notexist(file);
printf("back here");
}

return;
}
 
Old 12-06-2004, 05:38 AM   #2
Frustin
Member
 
Registered: May 2002
Location: Essex, UK
Distribution: Debian, Redhat, AIX 5L
Posts: 512

Rep: Reputation: 30
are you trying to get us to do your homework? you ought to read up on how `return' works. once you find out you'll quickly realise your mistake.
 
Old 12-06-2004, 06:21 PM   #3
pantera
Member
 
Registered: May 2004
Posts: 80

Original Poster
Rep: Reputation: 15
not homework

it is not a homework.........
i am doing some programming with sockets and gtk and i am stuck in the part where i have to get the messages again and again.........i mean once i get the message then the buffer which holds the message doesnt refresh so i used functions but it is not returning values...............i used return statement but it doesnt seem to work
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
segmentation fault on return statement crosseyedalien Programming 9 06-17-2005 12:23 PM
Do Perl functions usually modify variables, or return modified copies? Why? johnMG Programming 3 02-06-2005 10:22 PM
How to use return values from system functions? kpachopoulos Programming 2 07-30-2004 03:09 AM
value is lost from a return statement! what?? ludeKing Programming 3 05-30-2004 08:32 PM
pointers to functions/member functions champ Programming 2 03-28-2003 06:22 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:31 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration