&n writes the address of n . The address of a variable points to the value of that variable.
In C/C++, the # sign marks preprocessor directives. If you're not familiar with the preprocessor, it works as part of the compilation process, handling includes, macros, and more. It actually adds code to the source file before the final compilation.
From C/C++ programming perspective, the program entry point is main() function.
I am a beginner in C programming language, recently I have started learning functions, I have studied that functions use keyword return to return a value in the caller function. For example the following program.
int getVal(){
return 1000;
}
int main(){
int x = getVal();
printf("x = %d",x);
return 0;
}
will print x = 1000
but I am confused that (under turbo C compiler 32 bit) why the following program is producing output as x = 1000 too. Please explain.
int get_val(){
_AX = 1000;
}
int main(){
int x = get_val();
printf("x = %d",x);
return 0;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With