-5
嘿人們瀏覽stackoverflow,我正在嘗試爲我的NodeMCU板構建一個大程序,我需要幾個結構,但是我無法在這個小示例中使用它:Arduino IDE中的結構不起作用
struct Accounts{
String username;
String password;
int ip;
};
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
struct Accounts Random;// = {"Random", "This", 192614};
}
void loop() {
// put your main code here, to run repeatedly:
if(struct Accounts Random.username != Null){
Serial.print("Worked");
}
}
運行這個程序我得到的錯誤代碼:預期的主要表達式在'結構'之前。誰能幫我嗎?我已經嘗試使用typedef結構。
歡迎來到Stack Overflow。請花些時間閱讀[The Tour](http://stackoverflow.com/tour),並參閱[幫助中心](http://stackoverflow.com/help/asking)中的資料,瞭解您可以在這裏問。 –
通過試驗和錯誤學習C++是一個非常糟糕的主意。您應該從[此列表]中獲得一本書(http://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list)以瞭解基本知識。 –