1. Type of function

I understand four type of function in c language as following
Code:
void foo (void) // Functin does't take any value and doesn't return any value
void foo (int X) // Functin take value store in X and doesn't return any value
int foo (void) // Functin does't take any value and return integer value
int foo (int X) // Functin take value store in X and return integer value
I don't understand following type of function

Does it valid function?

Code:
int *foo ( int X)
What type of function it is ? What does it return ?

2. It's the same as your last example, except that the return type is pointer to int.

3. Originally Posted by laserlight
It's the same as your last example, except that the return type is pointer to int.
Thank you

Code:
struct S *F (struct S *T){
return T;
}
S is structure Name, T is structure variable

Is this function pass pointer to structure type struct ?
Is this function return pointer to structure type struct ?

What is F ? Is the function name F?

4. Where did you find this example? By now you should know enough to figure out from context.

Besides figuring out from context, there's another thing you can do: write a program to test your hypotheses. So you put this function definition in your program, declare struct S however it suits you, then you try and write code to use this function according to what you think is the answer. If it fails, then unless you made some typo, probably your hypothesis is wrong. If it compiles, then your hypothesis might be right (you can always come back here with your test program to ask someone to confirm).

I can of course tell you the answer right now, but this kind of exploration will help you get a stronger grounding in the concepts and syntax than just a quick reply from a community member.

5. Originally Posted by laserlight
I can of course tell you the answer right now, but this kind of exploration will help you get a stronger grounding in the concepts and syntax than just a quick reply from a community member.
I have written following code Just for doing experiment I have explain all with comments

Code:
#include<stdio.h>

// function F get content of Y pointer and return pointer P to function
int *F (int *P)
{
printf("P = %p \n", P); // Print content of pointer Y
++P;  // increment pointer value
return P; // return pointer P
}
int main ()
{
int *Y;  // Decleare pointer to integer
printf("Y = %p\n", Y); // Print content of pointer Y
Y = F (Y);	// call function F and pass content of Y
printf("Y = %p\n", Y); //  print content of Y after calling function
return 0;
}
Y = 00400080
P = 00400080
Y = 00400084