Products > Programming

button_port[start] = 0; has no storage class...... and conflicting data types

(1/3) > >>

Simon:
So


--- Code: ---
#define start 0
#define Bn 3
uint8_t button_port[Bn];
button_port[start] = 0;


--- End code ---

What did I do wrong? I hate GCC, it's error messages are cryptic and every time I do a new project just like another one in the past issue crop up that never did before.

Simon:
Oh and 0 is an invalid initializer, so is 1 and 2.

IanB:
Try this:


--- Code: ---#define SIZE 1
uint8_t button_port[SIZE];
button_port[0] = 0;
--- End code ---

Simon:
Sorry I got myself in a muddle, the array size is declared as 3. I corrected it.

andersm:
You're not trying to assign to the array outside a function, are you?

Navigation

[0] Message Index

[#] Next page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod