answersLogoWhite

0


Best Answer

All variables (and constants) must be declared before they can be used. This is so the compiler knows exactly how much memory to allocate to the variable, as the declaration tells the compiler exactly what the variable's type is.

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Why you have to declare variable first in turbo c?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Why you need to declare variable 1st in turbo c plus plus?

In C++ all names (including variables) must be declared before they can be used.


How you declare a variable in c language?

you have to give a statement in the following syntax datatype variable;


How do you use define in C?

Just type declare then the variable that you desire to assigned a certain constant value on it. Just type declare then the variable that you desire to assigned a certain constant value on it.


How do you download turbo c?

first what is urbo c?


Is it corrrect to declare a variable in c or c plus plus as two or three words for eg int seg no?

No., If you want to declare you jus use _ in between so the declaration will be like int seg_no;


Why all variables are declared with in the function?

It is not necessary to to declare variables inside the function in C. If you declare a variable inside a function, the variable becomes local for the function and another variable of same name can be declared in any other function, but you can not use the variable declared in other function. When you declare any variable outside the function body then the variable becomes global and can be used in any function of the program. Note: errno is an example for a variable declared outside any function.


Who is the founder of turbo c?

Turbo c program is from Borland which is an integrated development environment and a computer language. Some of the parts of turbo c were incorporated from the wizard c in 1987, but it was first developed by Dennis Ritchie in 1970.


Who is the founder of turbo c program?

Turbo c program is from Borland which is an integrated development environment and a computer language. Some of the parts of turbo c were incorporated from the wizard c in 1987, but it was first developed by Dennis Ritchie in 1970.


What is the differentiate of turbo c from turbo c plus plus?

Turbo C compiles c source. turbo c++ compiles c++ source code.


What is the difference between normal variable and register variable in c?

In C/C++ when we declare a variable; e.g int var; for this variable (i.e. var) memory is being reserved in RAM (i.e out side processor). If we declare variable like that; register int var2; for this variable memory is being reserved in register of CPU (i.e. withing processor) But register variables are discouraged because processor has to work with registers..... Note: strictly speaking, storage class 'register' means: dear compiler, you might optimize this variable into register, as I won't ever request its address. But of course, it's up to you to decide.


How do you declare a pointer variable in c?

int* pint; // instantiate a pointer to an int. float* pflt; // instantiate a pointer to a float.


What happen if you declare a global variable as static in C language?

When declared as static, the variable has internal linkage and its scope is restricted to the *.c file in which it is declared. It becomes visible to all functions within the file where it is declared and not to functions in other files.