answersLogoWhite

0


Best Answer

In C, a variable declared as static in a function is initialised once, and retains its value between function calls.

The default initial value of an uninitialized static variable is zero.

If a function or global variable is declared static, it can only be accessed in that file.

User Avatar

Wiki User

14y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

11y ago

Static identifier is an identifier whose value remain only in the scope in which it has been defined.

If "static" declaration is applied to external variable, it will limit the scope of that object to the rest of the source file being compiled.

This answer is:
User Avatar

User Avatar

Wiki User

11y ago

An identifier is a user-defined name we give to a variable (also known as a variable identifier). Without identifiers, we'd need to refer to every variable by its memory address. While this is fine for variables allocated in the data segment (where the offset address will be known at compile time), variables allocated on the heap will be allocated the first available address, which cannot be determined at compile time. Thus we give variables easy-to-remember names that we can then use to refer to the actual addresses they will be given at runtime. In effect, the identifier is an alias for a variable's address, but it's easier to think of them as identifiers for the variable itself. The identifier differentiates one variable from another and, if the name we choose to give those variables are self-explanatory, it makes our code that much easier to read and understand without the need for comments (the code becomes self-documenting).

Note that at compile time, all identifiers are completely stripped out. They're merely there to help us humans write the source code. At runtime, the computer will maintain its own internal table of variable addresses (much like an array of pointers) which it uses to identify where each variable resides in memory -- it therefore has no need for our human-readable identifiers.

Note that an identifier is not the same as a data type name. A type name determines the type of data an identifier represents. So a declaration such as MyClass x tells us that we want to allocate some memory, with a starting address we will refer to as x, and with an allocation size equivalent to sizeof(MyClass). The data type name also determines how the data stored in x is to be treated, which is itself determined by the MyClass declaration (which could either be a user-defined class, a struct, a union, an enum or a typedef).

Similarly, labels are user-defined names that we use to identify a specific point in our code, which allows our code to "jump" to that point at any time, using a goto statement (where the label and the goto are both defined within the same function). Again, labels are not identifiers, they are just labels.

However, the naming conventions that apply to identifiers also apply to user-defined data type names and to labels. Thus they are all generally classed as user-defined "names".

This answer is:
User Avatar

User Avatar

Wiki User

7y ago

An identifier is a user-defined name. Identifiers are composed from a string of alphanumeric symbols and underscores beginning with a leading letter or underscore. Identifiers must be unique to the scope (including the surrounding scope) in which they are declared, otherwise they will mask the existing identifier rendering it inaccessible within the scope of the new identifier.

Programmers use names to identify types (structures and unions), functions, objects (variables, constants and enumerations) and aliases (alternate names). The language provides several built-in names to identify the fundamental types (such as int, char, long and double) and the standard library provides user-defined type and function names we can use. All other names are defined by the programmer at compile time. Objects allocated on the heap (free store) are anonymous; they can only be referred to by their runtime address. Objects allocated in static memory or local memory (the call stack) can be referred to by their given name, an alias or by address.

This answer is:
User Avatar

User Avatar

Wiki User

6y ago

An identifier is a memory address. Identifiers can either be named or anonymous.

This answer is:
User Avatar

User Avatar

Wiki User

11y ago

Yes, you can use identifiers in C-programming. Examples: main, argc, argv, errno, printf.

This answer is:
User Avatar

User Avatar

Wiki User

16y ago

it is a symbol used to represent a value

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you define identifiers in c?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

2 types of identifiers in C programming language?

1. identifiers beginning with a letter 2. identifiers beginning with an underscore


What is the identifiers in turbo c?

all keywords


Is the identifiers 'name' and 'NAME' different in c?

Yes they is different, C language are case-sensitive.


What are the balance identifiers for disbursement accounting?

C, o, u, e


What are the balance identifiers for disbursement accounting stages?

C, o, u, e


Can a reserved word be used as an identifier name?

Identifiers are a bit more generic in the context of programming. If you mean, in terms of the C languages (C, C++, C#), the question is the reverse...keywords may NOT be used as identifiers. For example, you cannot use keywords such as "int", "float", "double", etc. as the names of variables or objects.


What is the exact definition of identifiers in c language?

An identifier is a name. All names must be declared with a type.


Are the identifiers name and NAME different in c?

If you mean 'are identifier of an object and nameof an object synonyms?', then yes, they are.


What is the maximum length allowed in difining a c variable?

In order to claim compliance with ANSI C standards, the minimum maximum for internal identifiers and macros is 63 characters, and external identifiers is 31 characters. Vendors are encouraged to avoid imposing a maximum value whenever possible.


What is the use of define key word in c?

Actually, the preprocessor is not part of the C compiler, but here you are: #define is meant to define symbols. Examples #define NULL ((void *)0) #define getchar() getc(stdin)


Which class is used to define the controls in c sharp?

.Ascx class file is used to define the controls in c#


What is the balance identifiers (BIDs) for disburesement Acounting stage?

Not o,e,r,u