Click here to Skip to main content
14,832,945 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: having problem to find an error Pin
CPallini28-Dec-20 20:22
mveCPallini28-Dec-20 20:22 
QuestionRe: having problem to find an error Pin
David Crow29-Dec-20 3:14
MemberDavid Crow29-Dec-20 3:14 
AnswerRe: having problem to find an error Pin
Patrice T30-Dec-20 12:42
mvePatrice T30-Dec-20 12:42 
In addition to other answers.

Advice: Learn to indent properly your code, it show its structure and it helps reading and understanding. It also helps spotting structures mistakes.
#include<bits/stdc++.h>
using namespace std;

int main()
{
	int t;
	cin>>t;
	std::string s[t];
	for(int i=0;i<=t-1;i++)
	{
		string st;
		getline(cin,st);
		int l=(int)st.length();
		string s2="",s3="";
		for(int i=0;i<=l;i++)
		{
			if(st[i]==' '||st[i]=='\0')
			{
				s3=s2+" "+s3;
				s2.clear();
			}
			else
			{
				s2+=st[i];
			}
		}
		s[i]=s3;
	}
	for(int i=0;i<=t-1;i++)
		cout<<s[i]<<endl;
	return 0;
}

Indentation style - Wikipedia[^]

Professional programmer's editors have this feature and others ones such as parenthesis matching and syntax highlighting.
Notepad++ Home[^]
ultraedit[^]
Enabling Open Innovation & Collaboration | The Eclipse Foundation[^]
Patrice

“Everything should be made as simple as possible, but no simpler.” Albert Einstein

Questiongdi+ bitmap save on existing file - showing error Pin
Gopi Nath24-Dec-20 22:21
MemberGopi Nath24-Dec-20 22:21 
AnswerRe: gdi+ bitmap save on existing file - showing error Pin
Richard MacCutchan24-Dec-20 23:33
mveRichard MacCutchan24-Dec-20 23:33 
GeneralSolved - gdi+ bitmap save on existing file - showing error Pin
Gopi Nath24-Dec-20 23:53
MemberGopi Nath24-Dec-20 23:53 
Questionstd:strstream does not work Pin
Haakon S.22-Dec-20 2:38
MemberHaakon S.22-Dec-20 2:38 
AnswerRe: std:strstream does not work Pin
Richard MacCutchan22-Dec-20 4:14
mveRichard MacCutchan22-Dec-20 4:14 
GeneralRe: std:strstream does not work Pin
Haakon S.22-Dec-20 22:21
MemberHaakon S.22-Dec-20 22:21 
GeneralRe: std:strstream does not work Pin
Richard MacCutchan22-Dec-20 23:37
mveRichard MacCutchan22-Dec-20 23:37 
GeneralRe: std:strstream does not work Pin
Stefan_Lang23-Dec-20 23:59
mveStefan_Lang23-Dec-20 23:59 
AnswerRe: std:strstream does not work Pin
Stefan_Lang23-Dec-20 23:56
mveStefan_Lang23-Dec-20 23:56 
GeneralRe: std:strstream does not work Pin
Haakon S.24-Dec-20 0:37
MemberHaakon S.24-Dec-20 0:37 
GeneralRe: std:strstream does not work Pin
Richard MacCutchan24-Dec-20 4:18
mveRichard MacCutchan24-Dec-20 4:18 
GeneralRe: std:strstream does not work Pin
Stefan_Lang24-Dec-20 5:10
mveStefan_Lang24-Dec-20 5:10 
GeneralRe: std:strstream does not work Pin
Haakon S.24-Dec-20 11:59
MemberHaakon S.24-Dec-20 11:59 
AnswerRe: std:strstream does not work. Solution (sort of) Pin
Haakon S.26-Dec-20 1:11
MemberHaakon S.26-Dec-20 1:11 
GeneralRe: std:strstream does not work. Solution (sort of) Pin
Randor 26-Dec-20 3:28
professional Randor 26-Dec-20 3:28 
QuestionConfigure Script Issue Pin
jblixt21-Dec-20 12:37
professionaljblixt21-Dec-20 12:37 
AnswerRe: Configure Script Issue Pin
Randor 21-Dec-20 13:01
professional Randor 21-Dec-20 13:01 
AnswerRe: Configure Script Issue Pin
k505421-Dec-20 17:42
mvek505421-Dec-20 17:42 
QuestionWriting a Factory Design Pattern Program with separate Header Files and Class Implementations Pin
Litu Sahoo17-Dec-20 12:26
MemberLitu Sahoo17-Dec-20 12:26 
AnswerRe: Writing a Factory Design Pattern Program with separate Header Files and Class Implementations Pin
Gerry Schmitz17-Dec-20 19:27
mveGerry Schmitz17-Dec-20 19:27 
AnswerRe: Writing a Factory Design Pattern Program with separate Header Files and Class Implementations Pin
Richard MacCutchan17-Dec-20 23:36
mveRichard MacCutchan17-Dec-20 23:36 
QuestionBeginning C++ for Windows Application Pin
chipp_zanuff13-Dec-20 6:06
Memberchipp_zanuff13-Dec-20 6:06 

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.