The C and C++ code snippets monologue forum

The C, C++, Code, Coder, Coding Snippets Zone for Tenouk.com

 

 
It is currently Thu Sep 09, 2010 1:05 am

All times are UTC




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: The functions and function calls
PostPosted: Sat Nov 18, 2006 3:25 am 
Offline
Site Admin

Joined: Fri Nov 03, 2006 12:42 am
Posts: 125
Compiler: Visual C++ Express Edition 2005
Compiled on Platform: Windows XP Pro SP2
Header file: Standard
Additional library: none/default
Additional project setting: Set project to be compiled as C
Project -> your_project_name Properties -> Configuration Properties -> C/C++ -> Advanced -> Compiled As: Compiled as C Code (/TC)
Other info:
To do: Just working program skeleton
To show: The functions and function calls

Code:
/* Don't forget to add the .h to the header file(s)! */
#include <stdio>

/* Function prototypes */
int a();
int b();
int c();

/* Function defintion */
int a()
{
   printf("I'm in a(), calling b() and then c()...\n");
   b();
   c();
   return 0;
}

int b()
{
   printf("I'm in b()...\n");
   return 0;
}

int c()
{
   printf("I'm in c()...\n");
   return 0;
}

int main()
{
   printf("I'm in main()...\n");
   a();
   b();
   c();
   return 0;
}


Output:

Code:
I'm in main()...
I'm in a(), calling b() and then c()...
I'm in b()...
I'm in c()...
I'm in b()...
I'm in c()...
Press any key to continue . . .


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Skin by Lucas Kane