just incase no one saw it in the other window here is two questions i need help with

o now i get it thanks your trigering back my memory um but hey i have another question what does endl mean and what would happen if you put the values 4 to k and 5 to n
____________________________________________________________
also i changed it now and there is still errors here is the program curently and its errors i cant figure out how to correct the errors ok here bye the way i have a dev c++ compiler

#include <stdlib.h>
using namespace std;


int main(int argc, char **argv)

{
int k,n;
k = 0;
n = 0;
cout<<"type a number";
cin>>k;
n=k*3;
cout<<endl<<n;

system ("pause"); /* execute M$-DOS' pause command */
return 0;
)

C:\Dev-Cpp\Untitled2.cpp In function `int main(int, char**)':
11 C:\Dev-Cpp\Untitled2.cpp `cout' undeclared (first use this function)
12 C:\Dev-Cpp\Untitled2.cpp `cin' undeclared (first use this function)
14 C:\Dev-Cpp\Untitled2.cpp `endl' undeclared (first use this function)
18 C:\Dev-Cpp\Untitled2.cpp expected primary-expression before ')' token
18 C:\Dev-Cpp\Untitled2.cpp expected `;' before ')' token
18 C:\Dev-Cpp\Untitled2.cpp expected `}' at end of input
C:\Dev-Cpp\Makefile.win [Build Error] [Untitled2.o] Error 1

Recommended Answers

All 10 Replies

you need to include iostream

#include <iostream>
// rest of program here

and } instead of ) in the end.

hey i have another question what does endl mean

endl

Inserts a new-line character in the stream and if the stream is a buffered stream then flushes it.

Read some samples or walkthroughs first!

cool thanks guys it worked and as far as the tutorial walkthroughs and samples i have all ready read them but i dont compleatly understand them mostly i have a tendency to `look so far ahead of the situation in to the abstract that i dont know whats happening in the present but i understand alot of it but i just need a picture of structure for the santax of the coding and if u guys know of any other tutorial websites in witch i could understand them better pleas tell me for example i wouldnt need c++ for dummies i would need c++ for dummies for dummies ok so thanks

>> i wouldnt need c++ for dummies

If you like tossing your money away, then go ahead and buy that book! Dispite its name its not really for dummies. There are many lots getter intoduction to C/C++ books available.

cool thanks guys it worked and as far as the tutorial walkthroughs and samples i have all ready read them but i dont compleatly understand them mostly i have a tendency to `look so far ahead of the situation in to the abstract that i dont know whats happening in the present but i understand alot of it but i just need a picture of structure for the santax of the coding and if u guys know of any other tutorial websites in witch i could understand them better pleas tell me for example i wouldnt need c++ for dummies i would need c++ for dummies for dummies ok so thanks

Maybe I am just being too picky, but are both the period keys of your keyboard broken? :confused:

NOPE NOT BROKEN I DONT CARE IF I USE CORRECT GRAMER ONLINE AS LONG AS IT GETS THERE AND THE PEOPLE CAN READ IT AND AS FOR Ancient Dragon I TOTALLY AGREE WITH YOU BUT WHAT ARE OTHER WAY BETTER BOOKS BECAUSE ALOT OF THE DUMMIES BOOKS SUCK LIKE U SAID OR I MEAN WHAT I INFERED FROM YOUR WRITING

look at the second post down from the top for some suggestions of books.

NOPE NOT BROKEN I DONT CARE IF I USE CORRECT GRAMER ONLINE AS LONG AS IT GETS THERE AND THE PEOPLE CAN READ

There's no need to shout either. You might think that spelling & grammar are superfluous online, but if people have to first decypher your message to understand your problem, you will generally get less helpful responses. Its your call.

IT AND AS FOR Ancient Dragon I TOTALLY AGREE WITH YOU BUT WHAT ARE OTHER WAY BETTER BOOKS BECAUSE ALOT OF THE DUMMIES BOOKS SUCK LIKE U SAID OR I MEAN WHAT I INFERED FROM YOUR WRITING

take a look at the book reviews section of http://www.accu.org
There's alot of books out there which are badly written and/or outdated, so check the reviews for books which are marked "highly recommended" or even "recommended". There's a section there containing reviews of beginners' books. I suggest you have a look at You Can Do It by Francis Glassborow, to get you started. the book, which is aimed at complete novices, assumes no programming experience at all. That one is much, much better than the "For Dummies" book IMO.

also lol i wasnt shouting i axadently hit the caps lock key

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.