Thread: Problems relating to conditional statements and fuctions.

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    May 2010
    Posts
    5

    Question Problems relating to conditional statements and fuctions.

    Hi.
    I need help. I would like to have a function that returns to it's parent function if conditions are not met, however my code will not compile. I am using Xcode 3. Here is the non functioning code:
    Code:
    #include <stdio.h>
    
    void first(void);
    
    int main()
    {
    	first();
    	printf("first completed successfully");
    }
    void first(void){
    	int		welcome;	
    	scanf( "%d", &welcome );
    	fpurge( stdin );
    	if(welcome == ""){
    		return();
    	}
    	else{
    		first();
    	}
    				}
    Thanks to anyone who can help.
    Last edited by Agroking; 05-07-2010 at 06:37 AM. Reason: Forgot to say thank you!

Popular pages Recent additions subscribe to a feed

Tags for this Thread