What is the meaning of a "." in front of the element in the struct? For example, goodvar
Reposted from: Baidu Knows
In the android bootloader source code directory, I found a struct definition in the lk/APP/javast. c file, which of the following experts can help me solve the problem? Struct atag_tcc_entry {char output; char resolution ;}; struct atag_tcc_entry tcc_param = {. output = 0 ,. resolution = 0,}; what I don't quite understand is why "=" is used after "truct atag_tcc_entry tcc_param" and why "is used before" output ". "dot". Which one can explain it?
2011-4-8 20:46
Satisfactory answer
"." Indicates the access member. The priority is the same as "()". For example, "object. member" or "Object-> member" indicate the meaning of a member accessing the object (read/write member ). That is, the variable used to access a member. This is just omitted. You can also write atag_tcc_entry.output = 0.
Question
Atag_tcc_entry.output = 0; you should have written an error? It should be tcc_param.output = 0;
Ygz23lkk | Level 3
Struct pcb_type {int ID; char name [5]; int priority; char State [5] ;}; void main () {void list (struct pcb_type PCB ); struct pcb_type PCB [10], * P; int I; for (I = 1, P = PCB; I <= 10; P ++, I ++) {printf ("Please input the date of PCB [% d]: \ n", I ); scanf ("% d \ n % s \ n % d \ n % s", & (p-> ID), & (p-> name ), & (p-> priority), & (p-> state) ;}for (I = 1; I <= 10; I ++) list (PCB [I]);} void list (PCB) struct pcb_type PCB; {printf ("% d % S % d % s", PCB. ID, PCB. Name, PCB. Priority, PCB. State); printf ("inputting complete! \ N ");} I can run the program compiled with VC!
Question
Another question is L: dprintf (Info, "lcdc: note by Duan, no ~ Defined (LCD _800_1_) \ n "); what is the difference between dprintf and the commonly used printf? The Info parameter is an integer constant defined in red, indicates the information level. I wonder if dpintf is output to the serial port for printing? I'm debugging an Android tablet. If dprintf is not displayed from the serial interface, how can I print debugging information from the serial port? I want to determine based on the debugging information defined by myselfProgramTo facilitate debugging.
0
| Comment
Chim692 | Level 2
". "Is the operator for Structure Variables to access its members. The initialization can be written as struct atag_tcc_entry tcc_param; // defines the structure variable atag_tcc_entry tcc_param.output = 0; // initialize the member atag_tcc_entry Limit = 0;