I am writing a code using Visual C++ to access serial port.
Code is given below:-
Code:HANDLE hSerial= CreateFile(L"COM1", GENERIC_READ | GENERIC_WRITE,0,0,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,0); DCB dcb = {0}; dcb.DCBlength=sizeof(dcbSerialParams); dcb.BaudRate=CBR_1200; dcb.ByteSize=8; dcb.StopBits=ONESTOPBIT; dcb.Parity=NOPARITY;
I am getting error in all last five lines in above code at dcb. and error is give below:-
Error: this declaration has no storage class or type specifier
I want to know where I am getting wrong and how to resolve this problem