Click here to Skip to main content
15,892,517 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Can't figure out this error... Pin
Nibu babu thomas6-Jul-08 20:53
Nibu babu thomas6-Jul-08 20:53 
GeneralRe: Can't figure out this error... Pin
AndreFratelli6-Jul-08 21:17
AndreFratelli6-Jul-08 21:17 
GeneralRe: Can't figure out this error... Pin
Nibu babu thomas6-Jul-08 21:40
Nibu babu thomas6-Jul-08 21:40 
GeneralRe: Can't figure out this error... Pin
AndreFratelli6-Jul-08 22:23
AndreFratelli6-Jul-08 22:23 
GeneralRe: Can't figure out this error... Pin
Nibu babu thomas6-Jul-08 22:26
Nibu babu thomas6-Jul-08 22:26 
QuestionC++ Classes (problem with events) Pin
marcio k6-Jul-08 20:10
marcio k6-Jul-08 20:10 
AnswerRe: C++ Classes (problem with events) Pin
andersod26-Jul-08 22:14
andersod26-Jul-08 22:14 
GeneralRe: C++ Classes (problem with events) Pin
Varghese Paul M6-Jul-08 22:55
Varghese Paul M6-Jul-08 22:55 
AnswerRe: C++ Classes (problem with events) Pin
KarstenK6-Jul-08 22:54
mveKarstenK6-Jul-08 22:54 
QuestionAbout batch file Pin
Nandu_77b6-Jul-08 19:15
Nandu_77b6-Jul-08 19:15 
AnswerRe: About batch file Pin
Rajesh R Subramanian6-Jul-08 20:03
professionalRajesh R Subramanian6-Jul-08 20:03 
QuestionRe: About batch file Pin
Nandu_77b6-Jul-08 21:19
Nandu_77b6-Jul-08 21:19 
QuestionRe: About batch file Pin
Rajesh R Subramanian6-Jul-08 21:31
professionalRajesh R Subramanian6-Jul-08 21:31 
QuestionRe: About batch file Pin
Nandu_77b6-Jul-08 22:10
Nandu_77b6-Jul-08 22:10 
AnswerRe: About batch file Pin
Rajesh R Subramanian6-Jul-08 23:23
professionalRajesh R Subramanian6-Jul-08 23:23 
GeneralRe: About batch file Pin
Nandu_77b7-Jul-08 0:01
Nandu_77b7-Jul-08 0:01 
AnswerRe: About batch file Pin
AndreFratelli6-Jul-08 20:06
AndreFratelli6-Jul-08 20:06 
GeneralRe: About batch file Pin
Nandu_77b6-Jul-08 22:04
Nandu_77b6-Jul-08 22:04 
QuestionRe: About batch file Pin
Nandu_77b6-Jul-08 22:14
Nandu_77b6-Jul-08 22:14 
AnswerRe: About batch file Pin
Nandu_77b6-Jul-08 22:21
Nandu_77b6-Jul-08 22:21 
AnswerRe: About batch file Pin
AndreFratelli6-Jul-08 22:15
AndreFratelli6-Jul-08 22:15 
GeneralRe: About batch file Pin
Nandu_77b6-Jul-08 22:24
Nandu_77b6-Jul-08 22:24 
QuestionDiffcult question Pin
nisha000006-Jul-08 19:11
nisha000006-Jul-08 19:11 
AnswerRe: Diffcult question Pin
AndreFratelli6-Jul-08 19:59
AndreFratelli6-Jul-08 19:59 
You can use something like this:

#define next(i) ((i) < 5 ? (i) + 1 : 1)
#define previous(i) ((i) > 1 ? (i) - 1 : 5)

int main()
{
	unsigned i, aux, j, cnt;

	for (i=1 ; i<6 ; i++)
	{
		for (aux = next(i) ; aux != previous(i) ; aux = next(aux))
		{
			cout << i << aux << next(aux) << endl;
		}

	}

	return 0;
}


The "next" macro increments a value until it reaches 5. When such happens, it returns to 1. The "previous" macro does the opposite, when the value reaches 1 it returns to 5.

regards
GeneralRe: Diffcult question Pin
nisha000006-Jul-08 20:27
nisha000006-Jul-08 20:27 

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.