Click here to Skip to main content
15,927,345 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Uu-Ha! Pin
Masaaki Onishi24-Sep-01 4:22
Masaaki Onishi24-Sep-01 4:22 
GeneralRe: Uu-Ha! Pin
G.Richard24-Sep-01 17:24
G.Richard24-Sep-01 17:24 
Questionusing STL vector? Pin
Gérald Mercet23-Sep-01 23:34
Gérald Mercet23-Sep-01 23:34 
AnswerRe: using STL vector? Pin
Christian Graus23-Sep-01 23:54
protectorChristian Graus23-Sep-01 23:54 
GeneralRe: using STL vector? Pin
Gérald Mercet24-Sep-01 0:17
Gérald Mercet24-Sep-01 0:17 
GeneralRe: using STL vector? Pin
Michael P Butler24-Sep-01 1:33
Michael P Butler24-Sep-01 1:33 
GeneralRe: using STL vector? Pin
Gérald Mercet24-Sep-01 2:14
Gérald Mercet24-Sep-01 2:14 
GeneralRe: using STL vector? Pin
Christian Graus24-Sep-01 2:27
protectorChristian Graus24-Sep-01 2:27 
double *Qi=new double[2*ni+1];
double *Qi1=new double[2*ni1+1];
*Qi1=1;
for(j=0;j<=2*ni;j++)
{
    *(Qi+j)=Arrow_Debreu(i,j,JMax,dr,dt,M,Alpha,Qi1);
}
Alpha=Alpha_i(StartDate,SwaptionEndDate,SwapEndDate,BaseAnnuelle,RateTable,VolatilitySurface,i,JMax,dr,dt,Qi);
*(pTab_Alpha+i)=Alpha;
for(j=0;j<=2*ni;j++)
{
   *(Qi1+j)=*(Qi+j);
//above, you could see the pb,because Qi and
//Qi1 don't have the same size;
// and i need to do this kind of operation
}
delete[] Qi;
delete[] Qi1;


Using vector you can do this easily. I still don't understand why you are doing this exactly, but using vector you could do the same thing by using the copy algorithm, with a back_inserter if need be, or just as a copy of the second vector is less than or equal to the first. Either way, allocating the vector size first would stop messy memory allocation stuff going on as you continually push_back.



Christian

As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.

Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
GeneralDirectX - Its Urgent Pin
23-Sep-01 23:12
suss23-Sep-01 23:12 
GeneralRe: DirectX - Its Urgent Pin
Christian Graus23-Sep-01 23:35
protectorChristian Graus23-Sep-01 23:35 
GeneralReal time graph plotting Pin
23-Sep-01 22:45
suss23-Sep-01 22:45 
GeneralRe: Real time graph plotting Pin
Jonathan de Halleux9-Nov-01 13:44
Jonathan de Halleux9-Nov-01 13:44 
QuestionHow to Send Message to CMainFrame Class To Redraw all child windows Pin
23-Sep-01 20:52
suss23-Sep-01 20:52 
AnswerRe: How to Send Message to CMainFrame Class To Redraw all child windows Pin
Steen Krogsgaard24-Sep-01 0:03
Steen Krogsgaard24-Sep-01 0:03 
GeneralRe: How to Send Message to CMainFrame Class To Redraw all child windows Pin
24-Sep-01 0:31
suss24-Sep-01 0:31 
GeneralRe: How to Send Message to CMainFrame Class To Redraw all child windows Pin
#realJSOP24-Sep-01 1:33
professional#realJSOP24-Sep-01 1:33 
GeneralRe: How to Send Message to CMainFrame Class To Redraw all child windows Pin
24-Sep-01 2:01
suss24-Sep-01 2:01 
GeneralRe: How to Send Message to CMainFrame Class To Redraw all child windows Pin
#realJSOP24-Sep-01 2:50
professional#realJSOP24-Sep-01 2:50 
GeneralRe: How to Send Message to CMainFrame Class To Redraw all child windows Pin
24-Sep-01 4:50
suss24-Sep-01 4:50 
GeneralRe: How to Send Message to CMainFrame Class To Redraw all child windows Pin
#realJSOP24-Sep-01 5:35
professional#realJSOP24-Sep-01 5:35 
GeneralNetMeeting SDK Pin
tfElep23-Sep-01 16:31
tfElep23-Sep-01 16:31 
GeneralRe: NetMeeting SDK Pin
Michael P Butler23-Sep-01 22:20
Michael P Butler23-Sep-01 22:20 
Generalreading from netware directory Pin
Hong Wye Kean23-Sep-01 15:57
Hong Wye Kean23-Sep-01 15:57 
GeneralChris's Grid Control Doc/View Pin
Matt Newman23-Sep-01 15:53
Matt Newman23-Sep-01 15:53 
GeneralRe: Chris's Grid Control Doc/View Pin
Christian Graus23-Sep-01 16:12
protectorChristian Graus23-Sep-01 16:12 

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.