Click here to Skip to main content
15,913,610 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Dynamically generate app title? Pin
Ravi Bhavnani20-Dec-02 2:45
professionalRavi Bhavnani20-Dec-02 2:45 
GeneralRe: Dynamically generate app title? Pin
Taka Muraoka20-Dec-02 2:50
Taka Muraoka20-Dec-02 2:50 
GeneralRe: Dynamically generate app title? Pin
Ravi Bhavnani20-Dec-02 2:56
professionalRavi Bhavnani20-Dec-02 2:56 
AnswerRe: Dynamically generate app title? Pin
Iain Clarke, Warrior Programmer19-Dec-02 13:56
Iain Clarke, Warrior Programmer19-Dec-02 13:56 
GeneralRe: Dynamically generate app title? Pin
Ravi Bhavnani19-Dec-02 13:58
professionalRavi Bhavnani19-Dec-02 13:58 
GeneralProgram Crashed, BUT, I have a DR.WATSON log Pin
Mike Doner19-Dec-02 12:32
Mike Doner19-Dec-02 12:32 
GeneralRe: Program Crashed, BUT, I have a DR.WATSON log Pin
Andreas Saurwein19-Dec-02 14:45
Andreas Saurwein19-Dec-02 14:45 
GeneralHelp: Vector class won't work (read this one) Pin
KBL19-Dec-02 10:44
KBL19-Dec-02 10:44 
Hi --

I have a simple question about dynamic memory and vectors:

Consider the vector class:

class vector
{

private:
int rows ;
double *vec ;

public:
vector(void) { rows=0 ; vec=0; } // default constructor

vector(int rows) // constructor
{
vec = new double[rows] ;
}

~vector(void) {} ; // destructor

} ;


when i use the class in MAIN() like:

vector* A ;
A = new vector(15) ;

I get an error. It's giving a "null reference error" and saying that the object has not been instantiated..

I don't get what I'm doing wrong?

Thanks



KBL
GeneralRe: Help: Vector class won't work (read this one) Pin
Christian Graus19-Dec-02 10:53
protectorChristian Graus19-Dec-02 10:53 
GeneralRe: Help: Vector class won't work (read this one) Pin
KBL19-Dec-02 12:00
KBL19-Dec-02 12:00 
GeneralRe: Help: Vector class won't work (read this one) Pin
Christian Graus19-Dec-02 12:34
protectorChristian Graus19-Dec-02 12:34 
GeneralRe: Help: Vector class won't work (read this one) Pin
KBL19-Dec-02 12:55
KBL19-Dec-02 12:55 
GeneralRe: Help: Vector class won't work (read this one) Pin
Christian Graus19-Dec-02 13:00
protectorChristian Graus19-Dec-02 13:00 
GeneralRe: Help: Vector class won't work (read this one) Pin
KBL19-Dec-02 13:07
KBL19-Dec-02 13:07 
GeneralRe: Help: Vector class won't work (read this one) Pin
Christian Graus19-Dec-02 13:40
protectorChristian Graus19-Dec-02 13:40 
GeneralRe: Help: Vector class won't work (read this one) Pin
KBL19-Dec-02 12:57
KBL19-Dec-02 12:57 
GeneralRe: Help: Vector class won't work (read this one) Pin
Alvaro Mendez19-Dec-02 10:55
Alvaro Mendez19-Dec-02 10:55 
GeneralRe: Help: Vector class won't work (read this one) Pin
KBL19-Dec-02 12:03
KBL19-Dec-02 12:03 
GeneralRe: Help: Vector class won't work (read this one) Pin
KBL19-Dec-02 12:07
KBL19-Dec-02 12:07 
GeneralRe: Help: Vector class won't work (read this one) Pin
KBL19-Dec-02 12:16
KBL19-Dec-02 12:16 
GeneralRe: Help: Vector class won't work (read this one) Pin
KBL19-Dec-02 13:01
KBL19-Dec-02 13:01 
GeneralRe: Help: Vector class won't work (read this one) Pin
Gary Kirkham20-Dec-02 3:52
Gary Kirkham20-Dec-02 3:52 
GeneralHelp: Vector class won't work Pin
KBL19-Dec-02 10:42
KBL19-Dec-02 10:42 
Generalvc++ ODBC dynaset,SQL_fetch_bookmark Pin
kingsley19-Dec-02 10:00
kingsley19-Dec-02 10:00 
GeneralRe: vc++ ODBC dynaset,SQL_fetch_bookmark Pin
Henrik_O20-Dec-02 1:09
Henrik_O20-Dec-02 1:09 

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.