• Some users have recently had their accounts hijacked. It seems that the now defunct EVGA forums might have compromised your password there and seems many are using the same PW here. We would suggest you UPDATE YOUR PASSWORD and TURN ON 2FA for your account here to further secure it. None of the compromised accounts had 2FA turned on.
    Once you have enabled 2FA, your account will be updated soon to show a badge, letting other members know that you use 2FA to protect your account. This should be beneficial for everyone that uses FSFT.

What could be wrong here?

phldbr

Limp Gawd
Joined
Nov 11, 2004
Messages
204
A simple for loop that is supposed to print out: 9876543
Code:
#include <iostream.h>
int main (void)
{
    int x;
    
    For (x=9; x>2; x--)
    cout << x ; 
        
     
    return 0;
}

I keep getting two errors when compiling.
 
cout is part of the std namespace. You need to have this above your main statement:
using namespace std;

You could also prepend cout with std:
std::cout << x;
 
for shouldn't be capitalized, presumably. then again you might want to tell us what the errors are that you're getting
 
I keep getting two errors when compiling.
You should show us the errors. We're left to guess, otherwise.

My guesses are that you mean "for" instead of "For", and that you mean "std::cout" instead of "cout".
 
:D
wow... I did not know that if I wrote it with a capital letter it would not work.
Thanks a lot guys.
Wrote "for" instead of "For" and everything is good.
 
C and C++ are case-sensitive for both variable names and language keywords.
 
Back
Top