Click here to Skip to main content
15,901,712 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalpointer of class instance [modified] Pin
rp_suman16-Mar-08 22:44
rp_suman16-Mar-08 22:44 
GeneralRe: pointer of class instance Pin
CPallini16-Mar-08 22:53
mveCPallini16-Mar-08 22:53 
GeneralRe: pointer of class instance Pin
Cedric Moonen16-Mar-08 23:01
Cedric Moonen16-Mar-08 23:01 
GeneralRe: pointer of class instance Pin
CPallini16-Mar-08 23:24
mveCPallini16-Mar-08 23:24 
GeneralRe: pointer of class instance Pin
Cedric Moonen16-Mar-08 23:30
Cedric Moonen16-Mar-08 23:30 
GeneralRe: pointer of class instance Pin
CPallini16-Mar-08 23:36
mveCPallini16-Mar-08 23:36 
QuestionRe: pointer of class instance Pin
rp_suman17-Mar-08 1:13
rp_suman17-Mar-08 1:13 
QuestionRe: pointer of class instance Pin
Maxwell Chen17-Mar-08 1:30
Maxwell Chen17-Mar-08 1:30 
GeneralRe: pointer of class instance Pin
rp_suman17-Mar-08 3:33
rp_suman17-Mar-08 3:33 
QuestionRe: pointer of class instance Pin
David Crow17-Mar-08 4:35
David Crow17-Mar-08 4:35 
GeneralRe: pointer of class instance Pin
rp_suman17-Mar-08 16:49
rp_suman17-Mar-08 16:49 
GeneralMemory leak in OnNewDocument() Pin
rp_suman16-Mar-08 22:39
rp_suman16-Mar-08 22:39 
GeneralRe: Memory leak in OnNewDocument() Pin
Cedric Moonen16-Mar-08 22:55
Cedric Moonen16-Mar-08 22:55 
GeneralRe: Memory leak in OnNewDocument() Pin
Rajkumar R16-Mar-08 23:51
Rajkumar R16-Mar-08 23:51 
QuestionRe: Memory leak in OnNewDocument() Pin
David Crow17-Mar-08 4:37
David Crow17-Mar-08 4:37 
GeneralRe: Memory leak in OnNewDocument() [modified] Pin
rp_suman17-Mar-08 14:56
rp_suman17-Mar-08 14:56 
GeneralRe: Memory leak in OnNewDocument() Pin
David Crow18-Mar-08 3:15
David Crow18-Mar-08 3:15 
QuestionHow to retrieve date,day ,hour ,minutes,seconds from DateTime Control?? Pin
Ashish Chauhan16-Mar-08 21:05
Ashish Chauhan16-Mar-08 21:05 
AnswerRe: How to retrieve date,day ,hour ,minutes,seconds from DateTime Control?? Pin
Ashish Chauhan16-Mar-08 21:06
Ashish Chauhan16-Mar-08 21:06 
GeneralRe: How to retrieve date,day ,hour ,minutes,seconds from DateTime Control?? Pin
Rajkumar R16-Mar-08 21:22
Rajkumar R16-Mar-08 21:22 
AnswerRe: How to retrieve date,day ,hour ,minutes,seconds from DateTime Control?? Pin
David Crow17-Mar-08 4:38
David Crow17-Mar-08 4:38 
GeneralCreating a Number Spiral Matrix [VC++] Pin
AnkurS16-Mar-08 20:17
AnkurS16-Mar-08 20:17 
hi guys,

this program creates number spiral Matrix

For example :
Enter a number : 4

01 02 03 04
12 13 14 05
11 16 15 06
10 09 08 07



Code :

#include <iostream.h>
int main()
{
int UserNo=1; // default Value
int StoreArray[100][100];

cout<<endl<<"Please enter a number :";
cin>>UserNo;
int Sqr=UserNo*UserNo;
int r=1,c=UserNo;
StoreArray[UserNo][UserNo];
int n=1;

do
{
for (int b=r;b<=c;b++)
{
StoreArray[r][b]=n;
n++;
}

for (b=r+1;b<=c;b++)
{
StoreArray[b][c]=n;
n++;
}

n--;
for (b=c;b>=r;b--)
{
StoreArray[c][b]=n;
n++;
}

for (b=c-1;b>=r+1;b--)
{
StoreArray[b][r]=n;
n++;
}

r++;
c--;

}while (n<sqr);>

if (UserNo%2!=0)
{
int mid=((UserNo/2) +1);
StoreArray[mid][mid]=Sqr;
}
// DISPLAYING

for (int a=1;a<=UserNo;a++)
{
for (int b=1;b<=UserNo;b++)
{
cout<<StoreArray[a][b]<<" | ";
}
cout<<endl;

}
return 1;
}
GeneralRe: Creating a Number Spiral Matrix [VC++] Pin
Maxwell Chen16-Mar-08 20:25
Maxwell Chen16-Mar-08 20:25 
GeneralRe: Creating a Number Spiral Matrix [VC++] Pin
Cedric Moonen16-Mar-08 21:08
Cedric Moonen16-Mar-08 21:08 
GeneralRe: Creating a Number Spiral Matrix [VC++] Pin
Himanshu Joshi16-Mar-08 22:06
Himanshu Joshi16-Mar-08 22:06 

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.