Click here to Skip to main content
15,921,941 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Refreshing problem.. Pin
Neha2-Feb-02 1:46
Neha2-Feb-02 1:46 
GeneralRe: Refreshing problem.. Pin
Wolfram Steinke2-Feb-02 11:52
Wolfram Steinke2-Feb-02 11:52 
GeneralKinda New at this Pin
1-Feb-02 17:17
suss1-Feb-02 17:17 
GeneralRe: Kinda New at this Pin
Rick York1-Feb-02 18:06
mveRick York1-Feb-02 18:06 
QuestionIs it possible to use multiple CDC's?? Pin
Jay Beckert1-Feb-02 17:18
Jay Beckert1-Feb-02 17:18 
AnswerRe: Is it possible to use multiple CDC's?? Pin
Paul M Watt1-Feb-02 21:37
mentorPaul M Watt1-Feb-02 21:37 
GeneralRe: Is it possible to use multiple CDC's?? Pin
Jay Beckert19-Jun-02 14:24
Jay Beckert19-Jun-02 14:24 
Questionwhat is wrong? Pin
1-Feb-02 16:00
suss1-Feb-02 16:00 
//******************** Stocks.cpp ********************/

#include "Stocks.h"
#include <string.h>
//========================================================

int Stocks::numOfStocks = 0;

Stocks:: Stocks()
{
numOfStocks++;
}

Stocks:: ~Stocks()
{
}

void Stocks:: addStock( Stock* st, int i)
{
i = numOfStocks;
Stock& myStocks[i] = st;
}

Compiling...
Stocks.cpp
C:\My Documents\DataStru\Stocks.cpp(21) : error C2057: expected constant expression
C:\My Documents\DataStru\Stocks.cpp(21) : error C2466: cannot allocate an array of constant size 0
C:\My Documents\DataStru\Stocks.cpp(21) : error C2234: '<unknown>' : arrays of references are illegal
C:\My Documents\DataStru\Stocks.cpp(21) : error C2440: 'initializing' : cannot convert from 'class Stock *' to 'class Stock *[]'
There are no conversions to array types, although there are conversions to references or pointers to arrays
Error executing cl.exe.

Stocks.obj - 4 error(s), 0 warning(s)


can any one tell me what is wrong with this piece of code
thank you
AnswerRe: what is wrong? Pin
Michael Dunn1-Feb-02 16:16
sitebuilderMichael Dunn1-Feb-02 16:16 
GeneralRe: what is wrong? Pin
Le centriste4-Feb-02 4:20
Le centriste4-Feb-02 4:20 
GeneralList Control Space Bug Pin
Swinefeaster1-Feb-02 14:10
Swinefeaster1-Feb-02 14:10 
QuestionClass prototype? Pin
1-Feb-02 14:05
suss1-Feb-02 14:05 
AnswerRe: Class prototype? Pin
Swinefeaster1-Feb-02 14:14
Swinefeaster1-Feb-02 14:14 
GeneralRe: Class prototype? Pin
Tim Smith1-Feb-02 14:40
Tim Smith1-Feb-02 14:40 
GeneralRe: Class prototype? Pin
Tantalus1-Feb-02 16:30
Tantalus1-Feb-02 16:30 
GeneralRe: Class prototype? Pin
Swinefeaster1-Feb-02 16:37
Swinefeaster1-Feb-02 16:37 
GeneralSort of Serialization Pin
1-Feb-02 14:00
suss1-Feb-02 14:00 
GeneralRe: Sort of Serialization Pin
Swinefeaster1-Feb-02 14:03
Swinefeaster1-Feb-02 14:03 
GeneralRe: Sort of Serialization Pin
1-Feb-02 14:44
suss1-Feb-02 14:44 
GeneralRe: Sort of Serialization Pin
Matt Gullett1-Feb-02 14:52
Matt Gullett1-Feb-02 14:52 
GeneralCMutex Pin
Cathy1-Feb-02 13:55
Cathy1-Feb-02 13:55 
GeneralRe: CMutex Pin
Rick York1-Feb-02 18:03
mveRick York1-Feb-02 18:03 
GeneralRe: CMutex Pin
Cathy1-Feb-02 20:39
Cathy1-Feb-02 20:39 
GeneralRe: CMutex Pin
Rick York1-Feb-02 21:08
mveRick York1-Feb-02 21:08 
GeneralRe: CMutex Pin
Cathy2-Feb-02 5:13
Cathy2-Feb-02 5: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.