A strange error has recently been found with the following error message:
Error c4430:missing type Specifier-int assumed. Note:c++ does not support Default-int
The source of the error (a company's technical test) is as follows:
#include <iostream>using namespace Std;main () {Long x=65530;long countx=0;while (x) {countx++;x=x& (x-1);} Cout<<countx<<endl;return Countx;}
Post-compilation errors such as prompt:
Here's how to do this: add/wd4430 to Command Line, C + +, Additional options, Configuration properties, properties, such as:
But what? Although the problem is solved, I also "know it does not know the reason why", if the master can be seen after the cause of the problem, but the personal guess and the compiler, only for reference, the reason for this speculation is the following paragraph code:
#include <iostream>using namespace Std;main () {int x=65302250;int countx=0;while (x) {countx++;x=x& (x-1);} Cout<<countx<<endl;return Countx;}
No problem after compiling!!!
can see that
int x=65302250;
No prompt error Oh ~ ~ ~
We know that the size of int is two bytes, i.e. -32768~32767, which is obviously out of range.
The rest is handed to the martial arts ~~~~~~~.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Error c4430:missing type Specifier-int assumed. Note:c++ does not support Default-int