View Single Post
nicolai's Avatar
Posts: 1,637 | Thanked: 4,424 times | Joined on Apr 2009 @ Germany
#11
Code:
Note::Note(QString Text)
{
    id = NULL;
    text = Text;
    status = NEW;
}
Just initialize your id variable with 0 instead of NULL.
NULL is used in C-code to initialize pointer variables with
a NULL-pointer. (In c++-code you can just use 0 for NULL-Pointer.)

Originally Posted by XenGi View Post
Maybe someone could post a little summary about the meaning of int i, int *i and int &i.
http://www.infernodevelopment.com/si...and-references
http://www.parashift.com/c++-faq-lite/index.html
Originally Posted by XenGi View Post
And why my compiler forbids me to do the following:

QDateTime *time;
time = QDateTime::currentDateTime();
Follow the advice from Joorin:
Originally Posted by Joorin View Post
Hint 2: If you want to get help with compiling things, paste all of what the compiler is complaining about together with the offending part of code. In this case, a line number would have been nice.
 

The Following 2 Users Say Thank You to nicolai For This Useful Post: