Click here to Skip to main content
15,902,900 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: HOOK, what and how to hook Pin
Pete O'Hanlon3-Mar-08 1:54
mvePete O'Hanlon3-Mar-08 1:54 
GeneralRe: HOOK, what and how to hook Pin
swarup3-Mar-08 4:20
swarup3-Mar-08 4:20 
GeneralRe: HOOK, what and how to hook Pin
Justin Perez3-Mar-08 5:09
Justin Perez3-Mar-08 5:09 
GeneralRe: HOOK, what and how to hook Pin
swarup3-Mar-08 5:22
swarup3-Mar-08 5:22 
Generaldouble Pin
viliam2-Mar-08 8:48
viliam2-Mar-08 8:48 
GeneralRe: double Pin
Alexander M.,3-Mar-08 3:31
Alexander M.,3-Mar-08 3:31 
GeneralRe: double Pin
viliam3-Mar-08 4:10
viliam3-Mar-08 4:10 
Generallogic of a small game Pin
tashe2-Mar-08 6:47
tashe2-Mar-08 6:47 
I want to make a small XO game (where you put XO or in my case * and - in order to win you need to have them in a line). For the insertion of a symbol in a place i figured out one way:

using namespace std;
int main() {
char matrix[3][3];
int a,b,choice,i,j;
for( i=1;i<4;i++) {
for(int j=1;j<4;j++) {
matrix[i][j]='0';
}
}
for(i=1;i<4;i++) {
cout<<endl;
for(j=1;j<4;j++) {
cout<<matrix[i][j]<<" ";
}
}
for (int k=1;k<10;k++) {
if ((k % 2) ==0) { cout<<"Choose a field for an '*' :"<<endl;
cin>>choice;

a= (choice / 3) + 1;

b= (choice % 3);
matrix[a][b]='*';
}
else {
cout<<"Choose a field for an '-' :"<<endl;
cin>>choice;
a= (choice / 3) + 1;

b= (choice % 3);
matrix[a][b]='-';
}

for( i=1;i<4;i++) {
cout<<endl;
for(j=1;j<4;j++) {
cout<<matrix[i][j]<<" ";
}
}
cout<<endl;
}
return 0;
}


When i run the program and fill the whole matric with symbols it displays an error :
Runtime check failure #2 : Stack around variable "matrix" was corrupted

Does anyone have a clue what its about>
GeneralRe: logic of a small game Pin
m@u2-Mar-08 7:25
m@u2-Mar-08 7:25 
GeneralPls do help me out......Very urgent!!!!! Pin
harish2rock2-Mar-08 6:42
harish2rock2-Mar-08 6:42 
GeneralRe: Pls do help me out......Very urgent!!!!! Pin
Joan M2-Mar-08 9:43
professionalJoan M2-Mar-08 9:43 
GeneralRe: Pls do help me out......Very urgent!!!!! Pin
harish2rock2-Mar-08 16:33
harish2rock2-Mar-08 16:33 
GeneralRe: Pls do help me out......Very urgent!!!!! Pin
Rajesh R Subramanian2-Mar-08 19:01
professionalRajesh R Subramanian2-Mar-08 19:01 
QuestionRe: Pls do help me out......Very urgent!!!!! Pin
Rajesh R Subramanian2-Mar-08 19:02
professionalRajesh R Subramanian2-Mar-08 19:02 
GeneralRe: Pls do help me out......Very urgent!!!!! Pin
harish2rock8-Mar-08 21:07
harish2rock8-Mar-08 21:07 
GeneralRe: Pls do help me out......Very urgent!!!!! Pin
harish2rock11-Mar-08 2:02
harish2rock11-Mar-08 2:02 
GeneralInnosetup and side-by-side assemblies Pin
dontknowitall2-Mar-08 3:51
dontknowitall2-Mar-08 3:51 
GeneralRe: Innosetup and side-by-side assemblies Pin
krmed2-Mar-08 7:42
krmed2-Mar-08 7:42 
GeneralRe: Innosetup and side-by-side assemblies Pin
dontknowitall2-Mar-08 8:52
dontknowitall2-Mar-08 8:52 
GeneralRe: Innosetup and side-by-side assemblies Pin
krmed3-Mar-08 0:43
krmed3-Mar-08 0:43 
GeneralRe: Innosetup and side-by-side assemblies Pin
PJ Arends2-Mar-08 22:35
professionalPJ Arends2-Mar-08 22:35 
QuestionCFileDialog Pin
Henri2-Mar-08 3:40
Henri2-Mar-08 3:40 
GeneralRe: CFileDialog Pin
Doc Lobster2-Mar-08 4:40
Doc Lobster2-Mar-08 4:40 
GeneralRe: CFileDialog Pin
Mark Salsbery2-Mar-08 7:21
Mark Salsbery2-Mar-08 7:21 
GeneralRe: CFileDialog Pin
Sameerkumar Namdeo2-Mar-08 16:15
Sameerkumar Namdeo2-Mar-08 16:15 

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.