Click here to Skip to main content
15,886,362 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
AnswerRe: Diffcult question Pin
AndreFratelli6-Jul-08 22:31
AndreFratelli6-Jul-08 22:31 
Questionsetting static IP address using win32 API Pin
an896-Jul-08 19:04
an896-Jul-08 19:04 
AnswerRe: setting static IP address using win32 API Pin
marcio k6-Jul-08 20:12
marcio k6-Jul-08 20:12 
AnswerRe: setting static IP address using win32 API Pin
killabyte6-Jul-08 23:23
killabyte6-Jul-08 23:23 
GeneralRe: setting static IP address using win32 API Pin
an896-Jul-08 23:50
an896-Jul-08 23:50 
AnswerRe: setting static IP address using win32 API Pin
Varghese Paul M6-Jul-08 23:29
Varghese Paul M6-Jul-08 23:29 
QuestionPrintPreviewDialog; Pin
Le@rner6-Jul-08 18:40
Le@rner6-Jul-08 18:40 
AnswerRe: PrintPreviewDialog; Pin
bob169726-Jul-08 19:04
bob169726-Jul-08 19:04 
GeneralRe: PrintPreviewDialog; Pin
Le@rner6-Jul-08 19:32
Le@rner6-Jul-08 19:32 
GeneralRe: PrintPreviewDialog; Pin
bob169727-Jul-08 4:03
bob169727-Jul-08 4:03 
QuestionHow to recognize that mouse doesn't move? Pin
Mohammad Khodaea6-Jul-08 18:14
Mohammad Khodaea6-Jul-08 18:14 
AnswerRe: How to recognize that mouse doesn't move? Pin
Naveen6-Jul-08 18:29
Naveen6-Jul-08 18:29 
Questionparameter default value Pin
bob169726-Jul-08 18:08
bob169726-Jul-08 18:08 
AnswerRe: parameter default value Pin
Nibu babu thomas6-Jul-08 18:34
Nibu babu thomas6-Jul-08 18:34 
Questioncannot add maximum and minimum button Pin
tataxin6-Jul-08 16:54
tataxin6-Jul-08 16:54 
AnswerRe: cannot add maximum and minimum button Pin
Nibu babu thomas6-Jul-08 17:27
Nibu babu thomas6-Jul-08 17: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.