Click here to Skip to main content
14,392,390 members

C / C++ / MFC

 
AnswerRe: Unexpected sequence of cout / perror in console output Pin
Richard MacCutchan10-Mar-19 23:52
mveRichard MacCutchan10-Mar-19 23:52 
GeneralRe: Unexpected sequence of cout / perror in console output Pin
k505411-Mar-19 3:28
Memberk505411-Mar-19 3:28 
GeneralRe: Unexpected sequence of cout / perror in console output Pin
Richard MacCutchan11-Mar-19 4:56
mveRichard MacCutchan11-Mar-19 4:56 
GeneralRe: Unexpected sequence of cout / perror in console output Pin
k505411-Mar-19 6:41
Memberk505411-Mar-19 6:41 
GeneralRe: Unexpected sequence of cout / perror in console output Pin
Richard MacCutchan11-Mar-19 6:52
mveRichard MacCutchan11-Mar-19 6:52 
GeneralRe: Unexpected sequence of cout / perror in console output Pin
k505411-Mar-19 12:59
Memberk505411-Mar-19 12:59 
GeneralRe: Unexpected sequence of cout / perror in console output Pin
leon de boer11-Mar-19 19:10
Memberleon de boer11-Mar-19 19:10 
QuestionC Programming[Solved] Pin
Evolt_Pratom9-Mar-19 2:07
MemberEvolt_Pratom9-Mar-19 2:07 
#include <stdio.h>
#include<conio.h>
#include<string.h>
	struct students {
	char name[20];
	int age;
};

void main(){

	struct students firstyear_bex[5];
	for(int i=0;i<5;i++){
		puts("Enter your name:");
		gets(firstyear_bex[i].name);
		puts("\n");
		puts("Enter your age:");
		scanf("%d",&firstyear_bex[i].age);
		
	}
	puts("\n");
	for(int i=0;i<5;i++){
		puts(firstyear_bex[i].name);
		puts("\t");
		printf("%d",firstyear_bex[i].age);
		puts("\n");
	}
}

i am a real begineer and i wanted to ask for the name and the details and display it like it is. but when i run it, the outputs are a bit funny, i dont get the proper order of printouts and when i enter something more it does nothing, but if i keep on entering it will take it but show all of it at the end with not the proper order. please help.
.
i use mingw gcc compiler

modified 10-Mar-19 9:42am.

AnswerRe: C Programming Pin
Richard MacCutchan9-Mar-19 2:27
mveRichard MacCutchan9-Mar-19 2:27 
GeneralRe: C Programming Pin
k50549-Mar-19 5:27
Memberk50549-Mar-19 5:27 
GeneralRe: C Programming Pin
Richard MacCutchan9-Mar-19 6:16
mveRichard MacCutchan9-Mar-19 6:16 
GeneralRe: C Programming Pin
Evolt_Pratom10-Mar-19 4:42
MemberEvolt_Pratom10-Mar-19 4:42 
GeneralRe: C Programming Pin
Richard MacCutchan10-Mar-19 8:02
mveRichard MacCutchan10-Mar-19 8:02 
Questiontemplate confusion Pin
Rw2377-Mar-19 14:00
MemberRw2377-Mar-19 14:00 
AnswerRe: template confusion Pin
Rw2378-Mar-19 3:37
MemberRw2378-Mar-19 3:37 
GeneralRe: template confusion Pin
Richard MacCutchan8-Mar-19 5:01
mveRichard MacCutchan8-Mar-19 5:01 
GeneralRe: template confusion Pin
Victor Nijegorodov8-Mar-19 7:21
MemberVictor Nijegorodov8-Mar-19 7:21 
GeneralRe: template confusion Pin
Rw2379-Mar-19 7:08
MemberRw2379-Mar-19 7:08 
GeneralRe: template confusion Pin
k50548-Mar-19 7:50
Memberk50548-Mar-19 7:50 
GeneralRe: template confusion Pin
Rw2379-Mar-19 6:57
MemberRw2379-Mar-19 6:57 
QuestionAero snap with CDockablePane Pin
jung-kreidler7-Mar-19 4:51
Memberjung-kreidler7-Mar-19 4:51 
AnswerRe: Aero snap with CDockablePane Pin
_Flaviu12-Mar-19 23:49
Member_Flaviu12-Mar-19 23:49 
GeneralRe: Aero snap with CDockablePane Pin
jung-kreidler13-Mar-19 0:31
Memberjung-kreidler13-Mar-19 0:31 
QuestionHow to run the C++ app on cluster? Pin
oleg635-Mar-19 7:39
professionaloleg635-Mar-19 7:39 
QuestionRe: How to run the C++ app on cluster? Pin
David Crow5-Mar-19 7:58
MemberDavid Crow5-Mar-19 7:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.