Click here to Skip to main content
15,887,135 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Global array question Pin
Luc Pattyn8-Apr-11 0:19
sitebuilderLuc Pattyn8-Apr-11 0:19 
AnswerRe: Global array question PinPopular
Stefan_Lang7-Apr-11 2:18
Stefan_Lang7-Apr-11 2:18 
GeneralRe: Global array question Pin
Albert Holguin7-Apr-11 3:51
professionalAlbert Holguin7-Apr-11 3:51 
GeneralRe: Global array question Pin
Cristoff8-Apr-11 0:16
Cristoff8-Apr-11 0:16 
Questionmemory leak problem Pin
shashankacharya6-Apr-11 18:35
shashankacharya6-Apr-11 18:35 
AnswerRe: memory leak problem PinPopular
Rajesh R Subramanian6-Apr-11 22:02
professionalRajesh R Subramanian6-Apr-11 22:02 
Questionupdate structure in a vector of structures Pin
csrss6-Apr-11 8:53
csrss6-Apr-11 8:53 
AnswerRe: update structure in a vector of structures Pin
csrss6-Apr-11 9:19
csrss6-Apr-11 9:19 
Ok, i am so stupid =/. Completely forgot about good old iteration with "int i".

typedef struct _S
{
	int a;
	std::string str;
}
S;

int main( void)
{
	std::vector<S> Vec;
	S s;
	s.a = 1; s.str = "hi";
	Vec.push_back(s);
	s.a = 2; s.str = "lol";
	Vec.push_back(s);
	s.a = 3; s.str = "nothing";
	Vec.push_back(s);

	std::vector<S>::iterator it;
	for(it = Vec.begin(); it != Vec.end(); it++)
	{
		cout << it->a << " : " << it->str.c_str() << endl;
	}

	for(unsigned int i = 0; i < Vec.size(); i++)
	{
		Vec[i].str = "BOOM!";
	}

	for(it = Vec.begin(); it != Vec.end(); it++)
	{
		cout << it->a << " : " << it->str.c_str() << endl;
	}
}

011011010110000101100011011010000110100101101110
0110010101110011

AnswerRe: update structure in a vector of structures Pin
Niklas L6-Apr-11 20:55
Niklas L6-Apr-11 20:55 
GeneralRe: update structure in a vector of structures Pin
csrss7-Apr-11 2:14
csrss7-Apr-11 2:14 
AnswerRe: update structure in a vector of structures Pin
Parthi_Appu6-Apr-11 23:32
Parthi_Appu6-Apr-11 23:32 
GeneralRe: update structure in a vector of structures Pin
csrss7-Apr-11 2:18
csrss7-Apr-11 2:18 
AnswerRe: update structure in a vector of structures [modified] Pin
Stefan_Lang7-Apr-11 4:01
Stefan_Lang7-Apr-11 4:01 
GeneralRe: update structure in a vector of structures Pin
csrss7-Apr-11 7:11
csrss7-Apr-11 7:11 
GeneralRe: update structure in a vector of structures Pin
Stefan_Lang7-Apr-11 20:44
Stefan_Lang7-Apr-11 20:44 
QuestionHow to create setup file of an EXE in Visual Studio 6.0 ? Pin
pjhelp6-Apr-11 4:10
pjhelp6-Apr-11 4:10 
AnswerRe: How to create setup file of an EXE in Visual Studio 6.0 ? Pin
Hans Dietrich6-Apr-11 4:13
mentorHans Dietrich6-Apr-11 4:13 
AnswerRe: How to create setup file of an EXE in Visual Studio 6.0 ? Pin
DanYELL6-Apr-11 16:16
DanYELL6-Apr-11 16:16 
GeneralRe: How to create setup file of an EXE in Visual Studio 6.0 ? Pin
Albert Holguin6-Apr-11 17:05
professionalAlbert Holguin6-Apr-11 17:05 
GeneralRe: How to create setup file of an EXE in Visual Studio 6.0 ? Pin
Hans Dietrich6-Apr-11 17:33
mentorHans Dietrich6-Apr-11 17:33 
GeneralRe: How to create setup file of an EXE in Visual Studio 6.0 ? Pin
Albert Holguin6-Apr-11 17:42
professionalAlbert Holguin6-Apr-11 17:42 
GeneralRe: How to create setup file of an EXE in Visual Studio 6.0 ? Pin
Rajesh R Subramanian7-Apr-11 6:41
professionalRajesh R Subramanian7-Apr-11 6:41 
GeneralRe: How to create setup file of an EXE in Visual Studio 6.0 ? Pin
Albert Holguin6-Apr-11 17:44
professionalAlbert Holguin6-Apr-11 17:44 
GeneralRe: How to create setup file of an EXE in Visual Studio 6.0 ? Pin
Hans Dietrich6-Apr-11 18:04
mentorHans Dietrich6-Apr-11 18:04 
GeneralRe: How to create setup file of an EXE in Visual Studio 6.0 ? Pin
Albert Holguin6-Apr-11 18:07
professionalAlbert Holguin6-Apr-11 18:07 

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.