answersLogoWhite

0

What are labels in c language?

Updated: 8/20/2019
User Avatar

Wiki User

11y ago

Best Answer

Labels in C are used for CASE statements and for GOTOs (many people forget that C has GOTOs). The syntax goes like this:

if (some_condition) { goto MyGotoLabel; }

...

...

MyGotoLabel:

...

...

switch (MyVariable) {

case 1:

...

break;

case 2:

...

break;

default:

...

}

As you can see, both GOTO and CASE labels use a colon, which is a giveaway that they both really do the same thing. The switch/case statement is more structured than the goto, since it branches out from a single point and cannot go backwards and the range of where it can branch to is more clearly delineated, so it's a less-bad goto. But it's really still a goto.

Note that, unlike most interpreted C-based languages, C can only use a constant integer value (or a preprocessor macro that evaluates to a constant integer value) for a case label.

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What are labels in c language?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is an identifier. what are the hearing rods for identifier 'c' language?

An identifier is the names given for labels, functions and variables in the c language.


What is the meaning of identifiers in c language?

The NAMES that identify or represent the variables, constants, data types, functions and labels in C language.. They are mere(only) NAMES, that help in IDENTIFYING variables, data types, constants, functions and labels to differentiate them from each other.. A good identifier must be descriptive but short..


Which is not an instruction for the assembly of a language?

labels


Why c language has name c why not a?

C-language was derived from B-language.


What does etiquetas mean in Spanish?

etiquetas means labels. use freetranslation.com next time you have a language question. its really easy!


What is previous language of c language?

language before c language is pascal


What is C language what does it do?

C Language is First Step of Programming Language, Help for C Language you are show the correct answer


What is the topNet class that everything is derived from in c?

C language: int (but C is NOT a .net language) C# language: object or System.Object


What is versions of c language?

versions of c language?


What do you mean by c language?

C is a programming language.


Is there a c in the greek language?

Yes, there is a symbol in the Greek alphabet that represents the /k/ sound, called “kappa.” However, the letter “c” like in the English alphabet does not exist in the Greek language.


Is c a dependent language?

C is a independent language