Does "return" always terminate the programm?
I have the following code
Code:
printf("Start. Give a\n");
scanf("%d",&a);
printf("\na is %d\n",a);
if (a==2)
{
return a;
printf("a is 2\n");
}
return 0;
1.If i put 2 the programm is terminated. Shouldn't it just output the value of a (2)? That happened on C++ I think.
2.And In my book I've red that with return you can restore the cotrol from a function to the main() function. This means that it works like "break;"
------------------------------------------------------------------------------------------------
My learning process on my blog