std::cin.get() looping text?

How do I fix that proplom and heres my code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include <stdlib.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>

int main()
 {
     //Config
     system("color F0");
     system("title HK-Konsole");
     //Starting console
     printf("Starting HK-Konsole 1.0...\n\n");
     Sleep(1806);
     printf(" ##############################################################################\n");
     printf(" #                                                                            #\n");
     printf(" #                                 HK-Konsole                                 #\n");
     printf(" #                                                                            #\n");
     printf(" ##############################################################################\n");
     //The console
     loop:
     printf("C:/Konsole/Commands/>");
     std::cin.get();
     printf("\n");
     goto loop;
 }
It would help if you told us what you were trying to do. Anyways, instead of an endless goto pattern you may want to look into using a while loop or do/while so it will end at some point. I would also advise you to not use arbitrary (magic) numbers like on line 13. Another thing to mention is you should try and avoid gotos and system. The last thing would be why are you using prinft for outputting but then cin for inputting? Why not use cout and cin or printf and scanf?
Topic archived. No new replies allowed.