need help with console coding

Posts 1–5 of 5 · Page 1 of 1
need help with console coding
hi guis,

i need a console:

i used this code for a console but there is a loop missing and i don t know how to code a loop > becouse i m still learning c++ someone have to edit this code and add a loop

Code:
#include <iostream>

using namespace std;

int main()

{
    float address;
	cin >> address;

		system("pause");
}
what the programm have to do:
- if i type a adress like this in it: 0x97342 and i press enter the console have to be empty and ... i can do it again.. type a adress in it and if i press enter again its empty again. <<< please add this on the code

if someone can help me successfull he get credits for the console!
[php]
#include <iostream>
using namespace std;

int main()
{
while(true)
{
float address;
cout << "Enter\n";
cin >> address;
cin.get();
system("cls");
}
}[/php]
Quote Originally Posted by Kallisti View Post
[php]
#include <iostream>
using namespace std;

int main()
{
while(true)
{
float address;
cout << "Enter\n";
cin >> address;
cin.get();
system("cls");
}
}[/php]
hmm dont work.. becouse if i write a address in it and press enter i can t write something again..
This loop will run ten times:

Code:
#include <iostream>
#include <conio.h> // getchar(); !Required only for pre 2010 Visual Studio's, and other IDE's.
using namespace std;

int main()

{
    float address;
    for(int x = 0; x < 10; x++) {
	// You will be prompted x times to run through the loop.
    cin >> address;
}

		getchar();
	//system("pause"); Avoid the use of "system" commands, their slow on dismissle from the HEAP. 
       // ...FIOS issue. Use getchar in place of ("pause")
}
Information:

This application will run through a loop x times. Each time prompting you to enter a value for variable 'address'. The previous value in the variable 'address' (if any) will then be overwriten. To avoid over writing values please use a vector or an array, or simply different variables.
Just get a regular book and learn form the beggining
Posts 1–5 of 5 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us