Click here to Skip to main content
15,905,785 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to dynamically load GdiPlus.dll? Pin
James Brown18-Jun-06 22:20
James Brown18-Jun-06 22:20 
Questionenter key Pin
Tara1416-Jun-06 6:51
Tara1416-Jun-06 6:51 
AnswerRe: enter key Pin
Jun Du16-Jun-06 7:56
Jun Du16-Jun-06 7:56 
GeneralRe: enter key Pin
Tara1416-Jun-06 8:58
Tara1416-Jun-06 8:58 
GeneralRe: enter key Pin
Tara1416-Jun-06 9:27
Tara1416-Jun-06 9:27 
QuestionExcluding random choices (std c++) Pin
Peter Charlesworth16-Jun-06 5:01
Peter Charlesworth16-Jun-06 5:01 
AnswerRe: Excluding random choices (std c++) Pin
capricious_00116-Jun-06 5:14
capricious_00116-Jun-06 5:14 
AnswerRe: Excluding random choices (std c++) [modified] Pin
Stephen Hewitt16-Jun-06 5:28
Stephen Hewitt16-Jun-06 5:28 
Here's how I'd do it:
#include <algorithm>
#include <iostream>
using namespace std;

int main(int argc, char* argv[])
{
	// Names and tasks.
	//
	typedef const char* PCSTR;

	PCSTR names[] =
		{
			"Bob",
			"Jane",
			"Tina",
			"Bill"
		};
	PCSTR* names_end = names+sizeof(names)/sizeof(names[0]);

	PCSTR tasks[] =
		{
			"is laughing",
			"is crying",
			"is jumping",
			"is having fun"
		};
	PCSTR* tasks_end = tasks+sizeof(tasks)/sizeof(tasks[0]);

	// Shuffle both arrays.
	//
	random_shuffle(names, names_end);
	random_shuffle(tasks, tasks_end);

	// Print out all entries in both arrays.
	//
	for (
		PCSTR *pName=names, *pTask=tasks;
		pName!=names_end && pTask!=tasks_end;
		++pName, ++pTask )
	{
		cout << *pName << " " << *pTask << "." << endl;
	}

	return 0;
}



Steve
GeneralRe: Excluding random choices (std c++) Pin
Garth J Lancaster16-Jun-06 16:33
professionalGarth J Lancaster16-Jun-06 16:33 
AnswerRe: Excluding random choices (std c++) Pin
Chris Losinger16-Jun-06 6:35
professionalChris Losinger16-Jun-06 6:35 
Question'HDEVINFO' and 'SP_DEVICE_INTERFACE_DATA' Pin
kitty516-Jun-06 4:49
kitty516-Jun-06 4:49 
AnswerRe: 'HDEVINFO' and 'SP_DEVICE_INTERFACE_DATA' Pin
Viorel.16-Jun-06 4:54
Viorel.16-Jun-06 4:54 
GeneralRe: 'HDEVINFO' and 'SP_DEVICE_INTERFACE_DATA' Pin
kitty516-Jun-06 5:02
kitty516-Jun-06 5:02 
GeneralRe: 'HDEVINFO' and 'SP_DEVICE_INTERFACE_DATA' Pin
Viorel.16-Jun-06 5:13
Viorel.16-Jun-06 5:13 
QuestionRe: 'HDEVINFO' and 'SP_DEVICE_INTERFACE_DATA' Pin
kitty516-Jun-06 5:18
kitty516-Jun-06 5:18 
AnswerRe: 'HDEVINFO' and 'SP_DEVICE_INTERFACE_DATA' Pin
Viorel.16-Jun-06 5:26
Viorel.16-Jun-06 5:26 
GeneralRe: 'HDEVINFO' and 'SP_DEVICE_INTERFACE_DATA' Pin
kitty516-Jun-06 5:48
kitty516-Jun-06 5:48 
GeneralRe: 'HDEVINFO' and 'SP_DEVICE_INTERFACE_DATA' [modified] Pin
Viorel.16-Jun-06 5:56
Viorel.16-Jun-06 5:56 
Questionhow to send unicode text in XlTable Pin
bassel_z16-Jun-06 4:45
bassel_z16-Jun-06 4:45 
QuestionDynamically allocating static variables Pin
capricious_00116-Jun-06 3:54
capricious_00116-Jun-06 3:54 
AnswerRe: Dynamically allocating static variables Pin
Laxman Auti16-Jun-06 4:07
Laxman Auti16-Jun-06 4:07 
GeneralRe: Dynamically allocating static variables Pin
capricious_00116-Jun-06 4:17
capricious_00116-Jun-06 4:17 
AnswerRe: Dynamically allocating static variables Pin
Viorel.16-Jun-06 4:28
Viorel.16-Jun-06 4:28 
GeneralRe: Dynamically allocating static variables Pin
capricious_00116-Jun-06 5:07
capricious_00116-Jun-06 5:07 
QuestionFinding Hex Pin
rajeevktripathi16-Jun-06 3:53
rajeevktripathi16-Jun-06 3:53 

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.