Console program display error! (DEV-C++) #19555

Closed
opened 2026-01-31 06:47:05 +00:00 by claunia · 6 comments
Owner

Originally created by @SkyNet-PKN on GitHub (Mar 19, 2023).

Windows Terminal version

1.16.10262.0

Windows build number

10.0.22621.0

Other Software

DEV-C++ 5.11

Steps to reproduce

I wrote a very simple C++ prgram, but it can't display correctly in terminal, however it can run well in old console window
ps. The terminal displayed differently each time, that really drove me crazy!!!

#include<bits/stdc++.h>
using namespace std;
int main(){
	int i,j;
	for(i=0;i<=52;i++){
		j=i+1;
		cout<<i<<' '<<j<<endl; 
	}
	return 0;
}

Expected Behavior

0 1
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 11
11 12
12 13
13 14
14 15
15 16
16 17
17 18
18 19
19 20
20 21
21 22
22 23
23 24
24 25
25 26
26 27
27 28
28 29
29 30
30 31
31 32
32 33
33 34
34 35
35 36
36 37
37 38
38 39
39 40
40 41
41 42
42 43
43 44
44 45
45 46
46 47
47 48
48 49
49 50
50 51
51 52
52 53

Actual Behavior


1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 11
11 12
12 13
13 14
14 15
15 16
16 17
17 18
18 19
19 20
20 21
21 22
22 23
23 24
24 25
25 26
26 27
27 28
28 29
29 30
30 31
31 32
32 33
33 34
34 35
35 36
36 37
37 38
38 39
39 40
40 41
41 42
42 43
43 44
44 45
45 46
46 47
47 48
48 49
49 50
50 51
51 52
52 53
                                                                                                                        27 28
28 29
29 30

or




















19 20
20 21
21 22
22 23
23 24
24 25
25 26
26 27
27 28
28 29
29 30
30 31
31 32
32 33
33 34
34 35
35 36
36 37
37 38
38 39
39 40
40 41
41 42
42 43
43 44
44 45
45 46
46 47
47 48
48 49
49 50
50 51
51 52
52 53
                                                                                                                        27 28
28 29
29 30

or

























24 25
25 26
26 27
27 28
28 29
29 30
30 31
31 32
32 33
33 34
34 35
35 36
36 37
37 38
38 39
39 40
40 41
41 42
42 43
43 44
44 45
45 46
46 47
47 48
48 49
49 50
50 51
51 52
52 53
                                                                                                                        27 28
28 29
29 30

and so on...

Originally created by @SkyNet-PKN on GitHub (Mar 19, 2023). ### Windows Terminal version 1.16.10262.0 ### Windows build number 10.0.22621.0 ### Other Software DEV-C++ 5.11 ### Steps to reproduce I wrote a very simple C++ prgram, but it can't display correctly in terminal, however it can run well in old console window ps. The terminal displayed differently **each time**, that really drove me crazy!!! ```cpp #include<bits/stdc++.h> using namespace std; int main(){ int i,j; for(i=0;i<=52;i++){ j=i+1; cout<<i<<' '<<j<<endl; } return 0; } ``` ### Expected Behavior ``` 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 52 53 ``` ### Actual Behavior ``` 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 52 53 27 28 28 29 29 30 ``` or ``` 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 52 53 27 28 28 29 29 30 ``` or ``` 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 52 53 27 28 28 29 29 30 ``` and so on...
claunia added the Needs-TriageIssue-BugResolution-Duplicate labels 2026-01-31 06:47:06 +00:00
Author
Owner

@bimarsh123 commented on GitHub (Mar 19, 2023):

What IDE are you using? I think IDE matters a lot when you are trying to getting output on terminal. I was having similar problems when I was using DEV- c++ but now the problem is fixed after I started using codeBlocks and visual studio.

@bimarsh123 commented on GitHub (Mar 19, 2023): What IDE are you using? I think IDE matters a lot when you are trying to getting output on terminal. I was having similar problems when I was using DEV- c++ but now the problem is fixed after I started using codeBlocks and visual studio.
Author
Owner

@j4james commented on GitHub (Mar 19, 2023):

This might be related to #14512.

@j4james commented on GitHub (Mar 19, 2023): This might be related to #14512.
Author
Owner

@SkyNet-PKN commented on GitHub (Mar 20, 2023):

What IDE are you using? I think IDE matters a lot when you are trying to getting output on terminal. I was having similar problems when I was using DEV- c++ but now the problem is fixed after I started using codeBlocks and visual studio.

actually not? I used notepad to write the same program and renamed it "test.cpp". Then I used "g++" command to complie it (complier is MinGW). But the problem remained.

A very strange thing happened. When I directly open test.exe, the problem appeared. But when I opened it in cmd (cmd in terminal, not classic console), the output was right

@SkyNet-PKN commented on GitHub (Mar 20, 2023): > What IDE are you using? I think IDE matters a lot when you are trying to getting output on terminal. I was having similar problems when I was using DEV- c++ but now the problem is fixed after I started using codeBlocks and visual studio. actually not? I used notepad to write the same program and renamed it "test.cpp". Then I used "g++" command to complie it (complier is MinGW). But the problem remained. A very strange thing happened. When I directly open test.exe, the problem appeared. But when I opened it in cmd **(cmd in terminal, not classic console)**, the output was right
Author
Owner

@SkyNet-PKN commented on GitHub (Mar 20, 2023):

In addition, output was also right in powershell in terminal

I think that's because DEV-C++ runs exe files differently from CodeBlocks and VisualStudio

@SkyNet-PKN commented on GitHub (Mar 20, 2023): In addition, output was also right in powershell in terminal I think that's because DEV-C++ runs exe files differently from CodeBlocks and VisualStudio
Author
Owner

@zadjii-msft commented on GitHub (Mar 20, 2023):

Yep, this looks consistent with /dup #14512. Thanks!

@zadjii-msft commented on GitHub (Mar 20, 2023): Yep, this looks consistent with /dup #14512. Thanks!
Author
Owner

@microsoft-github-policy-service[bot] commented on GitHub (Mar 20, 2023):

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@microsoft-github-policy-service[bot] commented on GitHub (Mar 20, 2023): Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#19555