Hi
I have a question.
I can only create a single constant ? i mean like only 1 symbol?
I want to create constants with b1,b2,b3,b4 value and soo on but i cant.
They are not working when not highlighted.
Any tips?
Thanks.
Hi
I have a question.
I can only create a single constant ? i mean like only 1 symbol?
I want to create constants with b1,b2,b3,b4 value and soo on but i cant.
They are not working when not highlighted.
Any tips?
Thanks.
const unsigned int vt_start = 'B1';
It'll compile and work, but whether it will do what you want, I don't know, because you don't tell us.
AWOL:
const unsigned int vt_start = 'B1';
It'll compile and work, but whether it will do what you want, I don't know, because you don't tell us.
Thanks, gotta try
A character ('char') variable can only contain one character:
char one_character = 'X';
An integer ('int') variable can contain up to two characters:
int two_characters = 'XY';
A long integer ('long') variable can contain up to four characters:
long four_characters = 'WXYZ';
A character array can contain a string of characters:
char string[] = "XYZABCDEFG";
(Note the use of double-quotes for a "string of characters" and the single quotes for 'character constants'. An additional character of value 0 is added to the string to mark the end.)
Any of them can be made constant by adding the 'const' keyword.
johnwasser:
A long integer ('long') variable can contain up to four characters:long four_characters = 'WXYZ';
The type of 'WXYZ' is int so this will not work as intended if you have 16-bit ints.