the compiler reports to me “Value computed is not used”. What is wrong here?
Note that although operators ‘++’ and ‘*’ have the same precedence, ‘++’ will be evaluated first, so this expression will be evaluated as *(ptr_to_a++); i.e. it increases the pointer, then reads the value from it (which is not used for anything). This is not what do you want, of course. To perform what do you want (i.e. to increase the variable pointed to by the pointer), use parentheses to change the order of evaluation, i.e. use (*ptr_to_a)++; This will work as expected.
Related Questions
- When I generate my business objects, I get a lot of compiler errors about "cannot convert from System.Data.SqlDbType to System.Data.DbType." What is wrong?
- I get compiler errors when trying to compile the provided code without changing anything. What is wrong?
- the compiler reports to me "Value computed is not used". What is wrong here?