Thread: Just Starting Functions

  1. #1
    Registered User
    Join Date
    Jan 2006
    Posts
    36

    Just Starting Functions

    Just started working with functions and I cant figure out why this doesnt work. Can someone please explain? I know its probably something dumb, I just need some fresh eyes!

    It only prints the Thank you for using our program message.

    TY Justin



    Code:
           #include <stdio.h>
    	
    	void Print_Intro_Heading();
    	
    	int main()
    	{
    	void Print_Intro_Heading();
    
    	printf ("\nThanks for using our Banking program!\n");
    
    	return 0;
    	}
    
    	// This function prints an overall title for the program output.  
    	void Print_Intro_Heading() 
    	{
    	printf ("************************************\n" 
    
                    "WELCOME TO THE JLH BANKING PROGRAM!\n"
    	
                    "***********************************\n");
    	}

  2. #2
    Slave MadCow257's Avatar
    Join Date
    Jan 2005
    Posts
    735
    Code:
    	int main()
    	{
    	void Print_Intro_Heading();
    Remove the void and it will work

  3. #3
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,079
    You don't need the datatype ("void") when you call the function. Think of it like a variable. Just use the identifier to access it. If you use the datatype it's like you're trying to declare it.
    Sent from my iPadŽ

  4. #4
    Registered User
    Join Date
    Jan 2006
    Posts
    36

    Ty

    Aha, I knew it was something dumb. Thanks Guys.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Is it legal to have functions within functions?
    By Programmer_P in forum C++ Programming
    Replies: 13
    Last Post: 05-25-2009, 11:21 PM
  2. i am not able to figure ot the starting point of this
    By youngashish in forum C++ Programming
    Replies: 7
    Last Post: 10-07-2004, 02:41 AM
  3. Factory Functions HOWTO
    By GuardianDevil in forum Windows Programming
    Replies: 1
    Last Post: 05-01-2004, 01:41 PM
  4. Help starting a C program with functions
    By jlmac2001 in forum C Programming
    Replies: 6
    Last Post: 10-12-2002, 02:43 PM
  5. functions - please help!!!!
    By linkies in forum C Programming
    Replies: 1
    Last Post: 08-21-2002, 07:53 AM