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

C / C++ / MFC

 
AnswerRe: problem with nested loops Pin
Mark Salsbery6-May-07 10:39
Mark Salsbery6-May-07 10:39 
GeneralRe: problem with nested loops Pin
longbowaj6-May-07 10:45
longbowaj6-May-07 10:45 
GeneralRe: problem with nested loops Pin
#realJSOP7-May-07 1:50
professional#realJSOP7-May-07 1:50 
GeneralRe: problem with nested loops Pin
Mark Salsbery7-May-07 4:19
Mark Salsbery7-May-07 4:19 
QuestionRemove help button from property sheet Pin
Max++6-May-07 8:45
Max++6-May-07 8:45 
AnswerRe: Remove help button from property sheet Pin
Tony Hill6-May-07 8:52
professionalTony Hill6-May-07 8:52 
GeneralRe: Remove help button from property sheet Pin
prasad_som6-May-07 20:36
prasad_som6-May-07 20:36 
Questiondynamic memory Pin
Dj_Lordas6-May-07 8:10
Dj_Lordas6-May-07 8:10 
hello,

here is sample code:

//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner) : TForm(Owner){
}
//---------------------------------------------------------------------------
int* Instructions(int nr, int dydis, int &index){
int* instr=new int[dydis];
for(int i=0; i<dydis; i++)
instr[i]="i;
index=dydis;
return" instr;
}
="" ---------------------------------------------------------------------------

void="" __fastcall="" tform1::button1click(tobject="" *sender){
int="" *instrarr,="" size,="" index="0," i;

size="StrToInt(Edit1-">Text);
for(i=0; i<size; i++){
instrarr="Instructions(i," size,="" index);
}
for(i="0;" i<index;="" i++){
instrarr[i]="InstrArr[i]*InstrArr[i];
Memo1-">Lines->Add(IntToStr(InstrArr[i]));
}
delete[] InstrArr;
}
//---------------------------------------------------------------------------





i found out that :

for(i=0; i<size; i++){
instrarr="Instructions(i," size,="" index);
}

is="" working="" some="" how="" not="" correctly.="" could="" i="" make="" it="" to="" work="" properly?

=""

<div="" class="ForumSig">Dj_Lord
AnswerRe: dynamic memory Pin
Dj_Lordas6-May-07 8:14
Dj_Lordas6-May-07 8:14 
AnswerRe: dynamic memory Pin
Mark Salsbery6-May-07 10:21
Mark Salsbery6-May-07 10:21 
GeneralRe: dynamic memory Pin
John R. Shaw6-May-07 12:13
John R. Shaw6-May-07 12:13 
GeneralRe: dynamic memory Pin
Mark Salsbery6-May-07 12:14
Mark Salsbery6-May-07 12:14 
GeneralRe: dynamic memory Pin
Dj_Lordas6-May-07 22:13
Dj_Lordas6-May-07 22:13 
GeneralRe: dynamic memory Pin
Dj_Lordas6-May-07 22:38
Dj_Lordas6-May-07 22:38 
GeneralRe: dynamic memory Pin
Mark Salsbery7-May-07 9:57
Mark Salsbery7-May-07 9:57 
Questioninteresting dynamic 2-d array and deleting it Pin
sawerr6-May-07 7:19
sawerr6-May-07 7:19 
QuestionWeb Services Pin
Demian Panello6-May-07 6:07
Demian Panello6-May-07 6:07 
AnswerRe: Web Services Pin
led mike6-May-07 9:11
led mike6-May-07 9:11 
GeneralRe: Web Services Pin
Demian Panello6-May-07 10:35
Demian Panello6-May-07 10:35 
QuestionImporting Textures Pin
outer heaven6-May-07 2:09
outer heaven6-May-07 2:09 
Questionchanging a process priority from another application Pin
mt_samiei6-May-07 0:36
mt_samiei6-May-07 0:36 
QuestionA tool for automatic renaming Pin
adamshuv6-May-07 0:35
adamshuv6-May-07 0:35 
AnswerRe: A tool for automatic renaming Pin
ThatsAlok16-May-07 19:50
ThatsAlok16-May-07 19:50 
QuestionFunction to clear all Cookies from Internet Explorer? Pin
shareholder7715-May-07 21:51
shareholder7715-May-07 21:51 
AnswerRe: Function to clear all Cookies from Internet Explorer? Pin
ThatsAlok16-May-07 19:50
ThatsAlok16-May-07 19:50 

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.