c - What is wrong here? Expected expression before '=' token? -


this question has answer here:

i trying set structure in c program writing. however, compiler returns expecting expression before '=' token on line 31. below snippet of code containing struct , line of code in question: edit: thread_count defined

#define thread_count = 120  struct threadinfo {     int threadid; };  struct threadinfo customerids[thread_count]; //offending line here 

i have tried chaning expression = sign, tried changing way struct declared, nothing has worked far. advice? edit 2: error resolved. definition of thread_count incorrect.

don't use = in #define statement. should be:

#define thread_count 120 

preprocessor definitions aren't variables, simple text replacement.


Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -