i am complete beginner to C++ . but i have some prior knowledge as a programmer with java and C# . in both languages we declare variables inside a main program which usual way of
Account a = new Account("abc",12);
but in C++ there are lot of options .such as
1 2
Account a("abc",123);
Account a = new Account("abc",12);
by further looking i found out that there are dynamic memory allocation problem and i did not understand it little bit. i hope someone here could clarify it to me.
At the same time i use QT for create some simple GUI program. i used very simple method .i declare the class ("NewClass") in one file and the main method in other file ("Main") and there are a class called "mainwindow " for event handle. so i tried to initialize the objects in "mainwindow" class but it always give me the error of "not in the scoop " error. i even try to make the class public and still not solved the problem. what type of syntax error i have done here. Thank you.