if i am having a following structure
if i am giving value asCode:struct emp { int acc; char name; }; struct emp e;
what the above statement mean. can anyone explain me...Code:e.acc|=ACC_NO;
thanks in advance...
if i am having a following structure
if i am giving value asCode:struct emp { int acc; char name; }; struct emp e;
what the above statement mean. can anyone explain me...Code:e.acc|=ACC_NO;
thanks in advance...
The last line of code shows the dot operator, which is used to access the parts of the struct. Note that "char name" is not an array of char's, but only a single char. To make it longer, you need to make it a char array - char name[40], for example.
Remember that a bunch of char's is not a string, in C. No matter how many there are of them. They are elevated to a string ONLY when they have an End of String marker char, placed as their last value: '\0'.
So: "Frederick" is not a string, but "Frederick\0" is one.
ya, you are right. But, i need help for the second statement in assigning values for structure elements. what's that "or(|)" symbol comes here.