Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what is the meaning of _AX = 1000 in the following C program?

Tags:

People also ask

WHAT IS &N in C?

&n writes the address of n . The address of a variable points to the value of that variable.

Why #is used in C?

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.

What is the starting point for C program?

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;
}