just started learning c++ using dev c++ from bloodshed.net.
My problem was learning strings. Wrote the script to allow me to put in a password and it would make changes to the string and print the string it made and end. I tried to put a Exit Y/N... sort of thing... and its gone haywire from then... the problem is it doesn't ask me for the password the second time...
you need to read more books about programing.
In first program, problem can be because you don't clean cin. But I don't know about it myself, as never used it.
I am trying to figure out the problem with a book.. but i am kinda like *big book... aaaaaaaah!!!* though i did check some places in the book where the problem could be solved but it left me confused.. Btw what is a Clean Cin? (clean sin... XD)
To your second program, if you are using dev C++, the program will close as soon as it's finished. Try putting this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#include <iostream>
#include <conio.h>
usingnamespace std;
int main ()
{
int a;
cout << "How many loops do you want?";
cin >> a;
while (a)
{
cout << a << endl;
--a;
}
getch();
return 0;
}