i need help

i need help

Post by kudakun on Sun Nov 30, 2008 5:17 pm
([msg=15655]see i need help[/msg])

i am new to C++ and i have the dev-C++ ver. 4.9.9.2 and i had bought a book to help teach me. it does help but when i go to use it and try out the example they dont work. ok heres an example from the book
Code: Select all
#include <iostream>

using namespace std:
     
int main(int argc, char* argv[])

{
    int Dividend = 1;
    cout << "Dividend: ";
    cin >> Dividend;
   
    int Divisor = 1;
    cout << "Divisor: ";
    cin >> Divisor;
   
    int Result = (Dividend/Divisor);
    cout << Result << end1;
   
    // Note: You must type something before the Enter key
    char StopCharacter;
    cout << end1 << "Press a key and \"Enter\": ";
    cin >> StopCharacter;
   
    return 0;
}

but when i go an put that into the dev-C++ it always comes up with some crap about it not liking line 3 (the one with the namespace) and a "building error"
here is what it says:
3 C:\Dev-Cpp\main.cpp expected `;' before ':' token
3 C:\Dev-Cpp\main.cpp expected unqualified-id before ':' token
3 C:\Dev-Cpp\main.cpp expected `,' or `;' before ':' token
C:\Dev-Cpp\Makefile.win [Build Error] [main.o] Error 1
i get that all the time but i dont understand how to realy fix it
kudakun
New User
New User
 
Posts: 2
Joined: Mon Sep 01, 2008 5:19 pm
Blog: View Blog (0)


Re: i need help

Post by BhaaL on Wed Jan 07, 2009 12:21 pm
([msg=15710]see Re: i need help[/msg])

Take care when reading/copying stuff from some webpage.

Its endl (end L, End Line), not end1 (end one).
BhaaL
Poster
Poster
 
Posts: 270
Joined: Sun Apr 13, 2008 11:16 am
Blog: View Blog (0)


Re: i need help

Post by L0DER on Fri Jan 09, 2009 9:52 am
([msg=15813]see Re: i need help[/msg])

Also
using namespace std:
the statement should be closed with a semicolon(;).
L0DER
New User
New User
 
Posts: 26
Joined: Tue Apr 22, 2008 12:58 am
Blog: View Blog (0)



Return to C and C++

Who is online

Users browsing this forum: No registered users and 0 guests