Click here to Skip to main content
15,915,501 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Compiled .dll in C++ for use in VB Pin
Nick Parker13-Feb-02 17:30
protectorNick Parker13-Feb-02 17:30 
GeneralRe: Compiled .dll in C++ for use in VB Pin
Rick York13-Feb-02 17:24
mveRick York13-Feb-02 17:24 
GeneralRe: Compiled .dll in C++ for use in VB Pin
Paul M Watt13-Feb-02 17:48
mentorPaul M Watt13-Feb-02 17:48 
GeneralRe: Compiled .dll in C++ for use in VB Pin
David Wengier13-Feb-02 18:37
David Wengier13-Feb-02 18:37 
Questionhow do we fix this? Pin
13-Feb-02 15:43
suss13-Feb-02 15:43 
Answerwe can only use string.h and iostream.h Pin
13-Feb-02 15:46
suss13-Feb-02 15:46 
GeneralRe: we can only use string.h and iostream.h Pin
13-Feb-02 16:04
suss13-Feb-02 16:04 
AnswerRe: how do we fix this? Pin
Derek Waters13-Feb-02 17:20
Derek Waters13-Feb-02 17:20 
Firstly, if you are using the < character in your message, you should check the "Display this message as-is" box so that the HTML doesn't get mangled.

Marwan wrote:
our teacher was saying that when we try to use this method in Stocks class it will automatically call the same ostream method in class Stock
can any one tell me how is that?


OK, I think what your teacher is saying is that if you have two classes:

class Stock
{
...
    ostream& operator << (ostream& s, Stock& stock);
};

class Stocks
{
    ostream& operator << (ostream& s, Stocks& stocks)
    Stock *m_aStocks;
}


then in the << operator of the Stocks class, you don't need to output all the individual members of each Stock object. Rather, the Stocks class should go through all the Stock objects, and call the << operator on the Stock class. Then, the << operator on the individual Stock class should output all the elements of Stock.

What this means is that the loop in the code you quoted shouldn't have a return statement inside it. You need to return once the loop is finished. Also, the << operator for Stocks shouldn't be << each element of each Stock.

Hope this helps.


------------------------
Derek Waters
derek@lj-oz.com
AnswerRe: how do we fix this? Pin
Kashif Manzoor13-Feb-02 22:19
Kashif Manzoor13-Feb-02 22:19 
GeneralAgain a callback question... m(__)m Pin
Mr.Freeze13-Feb-02 15:26
Mr.Freeze13-Feb-02 15:26 
GeneralRe: Again a callback question... m(__)m Pin
David Wengier13-Feb-02 15:33
David Wengier13-Feb-02 15:33 
GeneralRe: Again a callback question... m(__)m Pin
Mr.Freeze13-Feb-02 15:54
Mr.Freeze13-Feb-02 15:54 
GeneralRe: Again a callback question... m(__)m Pin
Lim Bio Liong13-Feb-02 16:28
Lim Bio Liong13-Feb-02 16:28 
GeneralRe: Again a callback question... m(__)m Pin
Mr.Freeze13-Feb-02 17:05
Mr.Freeze13-Feb-02 17:05 
GeneralRe: Again a callback question... m(__)m Pin
Lim Bio Liong13-Feb-02 18:08
Lim Bio Liong13-Feb-02 18:08 
GeneralRe: Again a callback question... m(__)m Pin
Mr.Freeze13-Feb-02 19:15
Mr.Freeze13-Feb-02 19:15 
GeneralRe: Again a callback question... m(__)m Pin
Lim Bio Liong13-Feb-02 22:58
Lim Bio Liong13-Feb-02 22:58 
GeneralRe: Again a callback question... m(__)m Pin
Mr.Freeze14-Feb-02 13:17
Mr.Freeze14-Feb-02 13:17 
GeneralRe: Again a callback question... m(__)m Pin
Lim Bio Liong14-Feb-02 20:54
Lim Bio Liong14-Feb-02 20:54 
GeneralRe: Again a callback question... m(__)m Pin
Joaquín M López Muñoz13-Feb-02 21:15
Joaquín M López Muñoz13-Feb-02 21:15 
GeneralRe: Again a callback question... m(__)m Pin
Lim Bio Liong13-Feb-02 22:46
Lim Bio Liong13-Feb-02 22:46 
GeneralRe: Again a callback question... m(__)m Pin
Joaquín M López Muñoz13-Feb-02 23:24
Joaquín M López Muñoz13-Feb-02 23:24 
GeneralRe: Again a callback question... m(__)m Pin
Lim Bio Liong13-Feb-02 23:52
Lim Bio Liong13-Feb-02 23:52 
GeneralRe: Again a callback question... m(__)m Pin
Mr.Freeze14-Feb-02 13:22
Mr.Freeze14-Feb-02 13:22 
GeneralImageList_Draw not working under XP Pin
David Wengier13-Feb-02 14:13
David Wengier13-Feb-02 14:13 

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.