GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

GeekInterview.com  >  Tech FAQs  >  Programming  >  C
Go To First  |  Previous Question  |  Next Question 
 C  |  Question 43 of 99    Print  
what is difference between function declaration and definition in c programming language

  
Total Answers and Comments: 1 Last Update: July 24, 2007     Asked by: poonam 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
July 24, 2007 08:42:25   #1  
baseersd Member Since: June 2007   Contribution: 34    

RE: what is difference between function declaration an...
Function Declaration means telling the compiler what are the types of arguments that are passed toa function , what type of data type it will return. It is ended with a semicolon (;).

Eg :
int add(int , int);
int add(int a, int b);

Definition of a function is the original logic that is written.What to do with the parameters passed and what has to be returned.

Eg :
int add(int a, int b)
{
     int c;
    c = a + b;
    return c;
}

Note: Here there is no semicolon for definition.

 
Is this answer useful? Yes | No

 Related Questions

Latest Answer : malloc and calloc both are used to assign memory to a varible dynamically.the space takes place in heap area.malloc is for single block  of memory(continous locations).calloc is for non continous blocks. ...
Read Answers (15) | Asked by : kshirod kumar mishra

Q1. write a program to find a given number is armstrong number or not ?Q2write a program which accepts a filename as a command line argument and reverse the contents of the file(i.e first character becomes the last character of the file and so on ?Q3 how can i call a function given its name as a string ?Q4 How to swap low-order byte and high order byte in an integer without using temporary variable?Q5 If we develop a project in C, then how can we create an .exe file of it?Q6 how to print 1 to 100
please let me know the answers to my email address as i having the interview in TCS so please please please please let me know  
Read Answers (16) | Asked by : M.srilatha

Q1 How to swap Low-order byte and high order byte in an integer without using temporary variable ?Q2 write a program to print numbers from 1 to 100 without using any condition checking ?Q3 If we develop a project in C,then how can we create an .exe file of it?Q4 Write a program which accepts a filename as a command like argument and reverse the contents of the file (i.e firs character becomesthe last character of the file and so on)input: the program takes the file name whose content should be
Read Answers (7) | Asked by : M.srilatha

Latest Answer : #include#includevoid main(){ int a,i;clrscr();printf( " enter the number");scanf("%d",&a);for(i=a;i

Latest Answer : Here is the code for palindrome with recursive mechanism#includeint rev=0; //Global Variableint REV(int num){if(num>0){ rev=(rev*10)+ (num %10); REV(num / 10); //calling the Function recursively.         ...
Read Answers (1) | Asked by : alok kumar

Latest Answer : Pointers to functions concept is used in C programming language in various instances. One of the common instance in which programmers use pointers to function concept is for passing pointers to a function as the name implies.For example the below declares ...
Tags : Pointer

Latest Answer : There are 2 points to be discussed......1. FREE FORM LANGUAGE - C is called FREE FROM beacuse the statements can be written from any position. Unlike COBOL, where each field/section needs to be started at a prefefined position. 2. MIDDLE LEVEL LANGUAGE ...

Latest Answer : For handling multithreading in c programming the two common libraries that is mainly used are LIBCMT.LIB and MSVCRT.LIB. The compiler must be ensured about the usage of these libraries while implementing multithreading in c programming. ...
Read Answers (1) | Asked by : supriya ahire

Latest Answer : Function Declaration means telling the compiler what are the types of arguments that are passed toa function , what type of data type it will return. It is ended with a semicolon (;).Eg : int add(int , int);int add(int a, int b);Definition of a function ...
Read Answers (1) | Asked by : poonam

Latest Answer : typedef struct means : it tells the allies name of structEX:typedef struct{int data,y;float s;}sa;sa s1,s2;struct: struct is a keyword for define a multlple type variable ...
Read Answers (1) | Asked by : Bairavi


 Sponsored Links

 
Related Articles

Concepts of Object-Oriented Programming

Object Oriented JavaScript In this chapter you ll learn about OOP Object Oriented Programming and how it relates to JavaScript As an ASP NET developer you probably have some experience working with objects and you may even be familiar with concepts such as inheritance However unless you re already a
 

C++ Pure Virtual Function and Base Class

C Pure Virtual Function and Virtual Base Class In this C tutorial you will learn about pure virtual function declaration of pure virtual function and virtual base class virtual base class and how to implement a virtual base class explained with examples mosgoogle center What is Pure Virtual Function
 

C++ Function Passing Types

C Function Passing Types In this C tutorial you will learn about function passing types two types of arguments passing in functions passed by value  and  passed by reference are discussed here mosgoogle center The arguments passed to a function can be performed in two ways Passed
 

What is Comprehensive Data Definition

A Comprehensive Data Definition refers to a formal data definition that provides a complete, meaningful, easily read, readily understood definition explaining the content and meaning of data. In a business enterprise environment where people are heavily depending on intelligent business systems (bus
 

What is DECODE function used for?

DECODE is used to decode a CHAR or VARCHAR2 or NUMBER into any of several different character strings or numbers based on value. That is DECODE does a value-by-value substitution. For every value that is given in the DECODE function it makes an if then check and matches the value. The general format
 

printf() Function Return Value

What is the return value from printf() function? printf function always returns the number of characters printed. Let us understand this with an example: main() { int a=10; printf("%d",printf("%d %d %d", a,a,a)); } In this above program the inner printf i
 

How is the main() function declared?

The declaration of main can be done as int main() One more declaration that can be taken by main is command line arguments form int main(int argc, char *argv[]) or this can also be written as int main(argc, argv) int argc; char *argv[]; NOTE: It is not possible for one to declare the main
 

How does the function call within function get evaluated?

Whenever we have more than one function which is called for a finite number of times then such a function gets evaluated from inside out. Let us understand this concept with an example. For instance consider a function sample called within it 4 times as given in program below: main() { int a=50;
 

What happens when a variable is not initialized in main function?

When a variable is not initialized in main function it contains garbage value. This can be well seen from the example below main() { int x; printf(“%d”,x); z= sample() } sample() { printf(“Testing program”); } Output is   &n
 

What is the default return value of a function?

The default return value from a function is int. In other words, unless explicitly specified the default return value by compiler would be integer value from function.   When a programmer wants other than integer values to be returned from function then it is essential that the pro
 





About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape