Retard here, whats the point of using identifiers in C

retard here, whats the point of using identifiers in C


for example couldn't I just say
char = 'a';

or do I need to say
char myChar = 'a';

what does the myChar do?

What are you going to refer to when you want to retrieve the variable in the first case?

This is terrible bait. If this isn't bait, read a book Jesus Christ you are dense.

type variable;
or
type variable = expression;
you are a literal brainlet

You don't need identifiers/variables. It's a meme. Just use 'a' (or whatever other value) in a code wherever you need to. ;-)

This is why java is a superior language

Identifiers are a convenience for when storing literals and a necessity when modifying data.

...

If you're too lazy to type a type declaration, just have your editor do it.

'a' obviously
why not help instead of being insulting?

What

char = 'a';

What is the point of doing any form of assignment in this case? You're not storing anything, because if you need to change 'a' to 'b', you'll just start using identifiers instead. In other words, you're basically saying "store 'a' as a character with nowhere" with this statement. You're just going to access 'a' directly later and it will be typecast to whatever you're using it as.
Now if you want to conceptualize 'a' as a piece of data which can be mutated or stored to retrieval, then you would use an identifier.

...

Don't listen to the other people in this thread, first way is way more concise.

>pajeet
this is bait

This is Sup Forums retard, don't ask for help we're all geniuses here

>'a' obviously
C'mon now

but why do i need to do the mychar part?

>'a' obviously

What do... Did you have algebra in school? If you have two different things... Let's say the grade 'a' and a student called 'a'. Would you really refer to just 'a' 'a'? When do you know if you are refering to the student or when you are refering to the grade? What do you do if you change the grade?

If you do
char myStudent = 'a'
char myGrade = 'a'

then you can easily change the grade with
myGrade = 'b'

if you just hard code everything with "a has grade a" every time then you don't need to program. But if you write

myStudent + "has grade" + myGrade

then you can change the student name or grade to anything instead of hardcoding every student name and grade (in which case you might as well do it on paper or just write it directly in word.

also... This is Sup Forums not a tech support or a place to learn programming, newfag. You will likely get ridiculed like many of us were when we first started coming here because we were retards. But we generally don't help people... We meme and argue about stupid autistic shit.

Read a basic programming book, any programming book.

Does anyone still do Windows programming with C and the Win32 API? If not what do people use?

...

>the absolute state of Sup Forums

Say my name is Roger.
string name = 'Roger';

This expresses that thatement. My name is Roger and it can be stored as a string. If someone wants my name in real life, they can ask me what my name is. Likewise, if I need to retrieve the name later in my code I can refer to it as name.
if (name == 'Roger') {
print('Hi Roger!');
}


Now let's explore the alternative.
string = 'Roger'

My Roger isn't Roger, my name is Roger, so this doesn't make sense.
If people wanted this value in real life, they would have to ask "what is your Roger?" This does not make sense because they would have to know my name before I told them.
In code, you have a similar problem.
if ('Roger' == 'Roger') {
print('Hi Roger!');
}

We are just comparing the name with itself here. The initial statement has nothing to do with this statement.

Let's explore comparing different name values with the first statement.
if (name == 'Roger') {
print('Hi Roger!');
} else if (name == 'Phillip') {
print('Fuck off Phillip.');
} else {
print('Literally who?');
}

We can now say "string name = 'Phillip'" or "string name = 'Regina'" and the program will act in different ways. Or, we can just say "string name" and read in the user's name from input.

However, if we do the alternative, here's how it looks.
if ('Roger' == 'Roger') {
print('Hi Roger!');
} else if ('Phillip' == 'Phillip') {
print('Fuck off Phillip.');
} else {
print('Literally who?');
}

The first statement will always evaluate to true no matter what we do, because 'Roger' is always equal to 'Roger'.

In your case, you're "name" part is the "myChar" part, and your 'Roger' is the 'a' part.

...

Is the official standard for C89 available for free, whether from ANSI or ISO, or has it been published as a book?