Click here to Skip to main content
15,906,766 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: variable 'bool' / header stdbool.h Pin
Aescleal20-Dec-10 3:55
Aescleal20-Dec-10 3:55 
QuestionWhy VC project won't run on Windows 7 Pin
ed welch19-Dec-10 10:45
ed welch19-Dec-10 10:45 
AnswerRe: Why VC project won't run on Windows 7 Pin
T210219-Dec-10 19:36
T210219-Dec-10 19:36 
GeneralRe: Why VC project won't run on Windows 7 Pin
ed welch20-Dec-10 1:31
ed welch20-Dec-10 1:31 
GeneralRe: Why VC project won't run on Windows 7 Pin
T210220-Dec-10 2:12
T210220-Dec-10 2:12 
QuestionOwner Button Width Pin
john563218-Dec-10 18:19
john563218-Dec-10 18:19 
AnswerRe: Owner Button Width Pin
Maximilien19-Dec-10 1:40
Maximilien19-Dec-10 1:40 
Question890927 - Invalid Input Format exception in sscanf_s Pin
ilostmyid218-Dec-10 1:48
professionalilostmyid218-Dec-10 1:48 
AnswerRe: 890927 - Invalid Input Format exception in sscanf_s Pin
ALLERSLIT18-Dec-10 2:59
ALLERSLIT18-Dec-10 2:59 
GeneralRe: 890927 - Invalid Input Format exception in sscanf_s Pin
ilostmyid218-Dec-10 3:19
professionalilostmyid218-Dec-10 3:19 
AnswerRe: 890927 - Invalid Input Format exception in sscanf_s Pin
Richard MacCutchan18-Dec-10 4:57
mveRichard MacCutchan18-Dec-10 4:57 
GeneralRe: 890927 - Invalid Input Format exception in sscanf_s Pin
ilostmyid218-Dec-10 7:53
professionalilostmyid218-Dec-10 7:53 
GeneralRe: 890927 - Invalid Input Format exception in sscanf_s Pin
Richard MacCutchan18-Dec-10 10:34
mveRichard MacCutchan18-Dec-10 10:34 
GeneralRe: 890927 - Invalid Input Format exception in sscanf_s Pin
ilostmyid218-Dec-10 18:52
professionalilostmyid218-Dec-10 18:52 
GeneralRe: 890927 - Invalid Input Format exception in sscanf_s Pin
Richard MacCutchan18-Dec-10 21:37
mveRichard MacCutchan18-Dec-10 21:37 
GeneralRe: 890927 - Invalid Input Format exception in sscanf_s Pin
ilostmyid219-Dec-10 0:29
professionalilostmyid219-Dec-10 0:29 
GeneralRe: 890927 - Invalid Input Format exception in sscanf_s Pin
Richard MacCutchan19-Dec-10 0:39
mveRichard MacCutchan19-Dec-10 0:39 
GeneralRe: 890927 - Invalid Input Format exception in sscanf_s Pin
ilostmyid219-Dec-10 0:49
professionalilostmyid219-Dec-10 0:49 
GeneralRe: 890927 - Invalid Input Format exception in sscanf_s Pin
jschell19-Dec-10 9:50
jschell19-Dec-10 9:50 
GeneralRe: 890927 - Invalid Input Format exception in sscanf_s Pin
ilostmyid222-Dec-10 19:42
professionalilostmyid222-Dec-10 19:42 
Question'Fake' the freespace of a hdd Pin
ALLERSLIT17-Dec-10 23:54
ALLERSLIT17-Dec-10 23:54 
AnswerRe: 'Fake' the freespace of a hdd Pin
Richard MacCutchan18-Dec-10 4:43
mveRichard MacCutchan18-Dec-10 4:43 
QuestionRe: 'Fake' the freespace of a hdd Pin
David Crow20-Dec-10 3:19
David Crow20-Dec-10 3:19 
QuestionFor Loop & Array Issue. Pin
Mike Certini17-Dec-10 10:48
Mike Certini17-Dec-10 10:48 
I am in the process of learning how to use arrays. To be more specifc, how to modify the code of "for loops" to learn different ways to work with arrays. Listed below is a basic program where I am attempting to learn how to modify a two dimensional array. I would like to place a 1 in the first dimension and a 2 in the second dimension.

The issue I do not understand is why my for loop is advancing to array element 2. Shouldn't the elements updated through the loop be [0] and [1]? Shouldn't my for loop stop when it encounters the for statement test condition <=1?

What is happening is that the statement advances to element [2]. Do I have a correct understanding of the for loop? Advice is much appreciated.

#include <iostream>
using std::endl;
using std::cout;
using std::cin;

int initialize[2][2];										//Initialize rows / columns	
int row;
int col;

int main()
	{
// Two rows
	for(row=0;row<=1;row++)									//Populate rows last.
		{
		//initialize[row][col] = 2;
		// Two columns
		for(col=0;col<=1;col++)								//Populate columns first.
			{
			//cout << initialize[i][col] << "1";
			initialize[row][col] = 1;						
			cout << "Row  ""Col  "<< row << col << initialize[row][col] << '\n';
			
			}
		}
	}

AnswerRe: For Loop & Array Issue. Pin
User 742933817-Dec-10 11:01
professionalUser 742933817-Dec-10 11:01 

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.