answersLogoWhite

0


Best Answer

global and static

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Which variable is initialized once when program is compiled?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Can static variables be changed?

No, a static variable means that there is only one copy of that variable, and it is shared by all members of the class, or by all callers of a function.A variable that is read-only would be marked as const or final (depending on language).


What are the difference between private variable and final variable?

A private variable is one that is accessible only to the current class and cannot be accessed by any other class, including the ones that extend from it. A final variable is one that cannot be modified once it is initialized and assigned a value.


If the variable flag can only be declared once in the program it was declared as what type of variable?

It's a global variable.


How do you run c program without ideon dos?

Once the application is compiled, there is no need for an IDE.


What value cannot be changed once it is initialized?

A constant value.


What are final variable?

Declaring a variable with the final keyword makes it impossible to reassign a different value to that variable once it has been initialized with an explicit value (notice we said explicit rather than default). For primitives, this means that once the variable is assigned a value, the value can't be altered. For example, if you assign 10 to the int variable x, then x is going to stay 10, forever. That's pretty straightforward for primitives, but what does it mean to have a final object reference variable? A reference variable marked final can't ever be reassigned to refer to a different object. The data within the object can be modified, but the reference variable cannot be changed. In other words, if you have a final employee object variable, you can modify aspects of the employee but you cannot have the variable refer to say a manager.


What is a constant object in c plus plus?

A constant object is one that, once initialized, never changes value.


What are runtime errors in c?

A run time error occurs when a compiled program executes, and during execution, the binary code attempts a task that is not permitted by the operating system or libraries. Divide by zero is an example of a run time error. When the executed program divides one variable by a second variable, and the second variable holds a value of zero, the run time library will issue a run time error. Since the compiler cannot predict the values held by the variables, it cannot prevent such an error from occurring, and so the run time library traps the run time error during program execution. . Some run time errors include: - divide by zero - no stack space - memory reference out of bounds - write protected file


Is C compiled or interpreted?

Assembler, COBOL, PL/I, C/C++ are all translated by running the source code through a compiler. This results in very efficient code that can be executed any number of times. The overhead for the translation is incurred just once, when the source is compiled; thereafter, it need only be loaded and executed. Interpreted languages, in contrast, must be parsed, interpreted, and executed each time the program is run, thereby greatly adding to the cost of running the program. For this reason, interpreted programs are usually less efficient than compiled programs. Some programming languages, such as REXX™ and Java™, can be either interpreted or compiled.


Explain reference variable and how it is different from pointer variable?

In JAVA, all variables are reference variables, and there are no pointer variables. Even though the platform may implement them as pointers, they are not available as such. In C, no variables are reference variables. They are a C++ enhancement. In C++ a reference variable is syntactically the same as a pointer variable, except that the use of the indirection operator (*) is implicit. You do declare reference variables slightly differently than pointer variables but, once you do so, they can be treated as non-pointer variables. Reference variables also cannot be redefined once they have been initialized to point to some object. They are const. Structurally, there is no difference between a pointer variable and a reference variable. They are both still pointers. The compiler just makes it easier to treat reference variables and non-pointer variables the same way.


Can BASIC language can be written on notepad?

Sure, it can. I like to use a word processor or notepad to do search/replace, adjust indents, etc. and then to transfer to the compiler. Once compiled, the executable program cannot be edited effectively outside the Basic environment.


Is productCost equals 100 a valid variable?

Sort of. Once it is set to 100, it is no longer a variable.