I'll clarify what your code is doing here.
Here, you've created a prototype of
main( ) but you never defined its body. You should receive an undefined reference to
main( ) here.
kcomp11 wrote: |
---|
1 2
|
int i=0;
while (i<10);
|
|
Here, you've declared (and initialized, which is surprising) a single integer variable. You then create a
while loop construct that does absolutely nothing. Instead, you make no time for the CPU, hence the excessive CPU usage (check Task Manager (if you're running Windows)). To fix this, simply remove the semi-colon after the test condition and place a set of braces ({...}) after the test condition. Then, within those braces, place
i++. Your loop never increments
i, so your loop will be going forever plus one.
This is a separate scope. Since you placed the semi-colon after the test condition of
while, this scope is not a part of the
while loop construct.
system is not a
class or a
namespace. Assuming this was a
namespace, you would use the scope resolution operator (::), not the member access operator (.).
Wazzak