Click here to Skip to main content
15,924,553 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Is pointers in C++ a headache for real world programmers? Pin
Michael Dunn31-May-03 5:38
sitebuilderMichael Dunn31-May-03 5:38 
AnswerRe: Is pointers in C++ a headache for real world programmers? Pin
valikac31-May-03 7:02
valikac31-May-03 7:02 
AnswerRe: Is pointers in C++ a headache for real world programmers? Pin
Daniela12331-May-03 7:20
Daniela12331-May-03 7:20 
AnswerRe: Is pointers in C++ a headache for real world programmers? Pin
Vikram A Punathambekar31-May-03 8:57
Vikram A Punathambekar31-May-03 8:57 
AnswerRe: Is pointers in C++ a headache for real world programmers? Pin
Michael P Butler31-May-03 9:04
Michael P Butler31-May-03 9:04 
AnswerRe: Is pointers in C++ a headache for real world programmers? Pin
Bob Stanneveld31-May-03 9:25
Bob Stanneveld31-May-03 9:25 
GeneralRe: Is pointers in C++ a headache for real world programmers? Pin
Peter Weyzen31-May-03 10:15
Peter Weyzen31-May-03 10:15 
GeneralRe: Is pointers in C++ a headache for real world programmers? Pin
Bob Stanneveld31-May-03 13:35
Bob Stanneveld31-May-03 13:35 
Well, I remember OBJECT PASCAL. They try to prevent the use of pointers. I couldn't even find information about pointers in the delphi help files!

The 'auto-delete-reference-counter thingy' from Java is called the garbage collector. This is one of the many things that make Java a slow language!
Some people also tried to implement a garbage collector in C++, but failed at some aspects. The reference counting is done by so-called 'smart pointers'. A topic about C++ garbage collecting and 'smart pointers' is around here somewhere.

Almost everyone in my class didn't start their programming experience with C/C++. Almost everyone (with experience) was aquainted with (object) PASCAL, Java, Visual Basic. They all did well, until we got tje subject 'C'. Almost everyone failed at understanding pointers. They didn't know with what the were dealing with (maybe they're just stupid).
So my opinion is: If you want to learn how to program, start with C/C++. Why? You don't get used to 'easy' programming and when you know something about C/C++, no other language is hard to learn. They are all easier than C/C++. If you do it the other way around, you still got a hard language to learn!

The 'super' keyword is indeed a handy thing, but C++ allows a similar construction!
exemple:

<br />
// base class<br />
class A<br />
{<br />
private:<br />
    int n;<br />
public:<br />
    A();<br />
    int GetInt();<br />
};<br />
A::A()<br />
{ n = 1; }<br />
int A::GetInt()<br />
{ return n; }<br />
<br />
// derived class<br />
class B : public A<br />
{<br />
private:<br />
    double b;<br />
public:<br />
    B();<br />
    double GetDouble();<br />
}<br />
<br />
// You can call a inherited constructor in 2 ways:<br />
// 1) this method doesn't work with other functions, only the constructor!!<br />
B::B() : A()<br />
{<br />
  // The first thing that is done, is the call to A(), afterwards this code <br />
  // is executed<br />
  d = 1.1;  <br />
}<br />
<br />
// 2) this method works with all types of functions<br />
B::B()<br />
{<br />
   d = 1.1;<br />
   A::A(); // 'A::' is the C++ version of 'super'<br />
           // this is just a normal function call, and can be placed<br />
           // anywhere, where a statement would be legal!<br />
}<br />


Did you know that there is a way to interface assembly with C/C++? This can be achieved by using the __asm keyword. Consult your help or the online msdn library for more details
AnswerRe: Is pointers in C++ a headache for real world programmers? Pin
geo_m1-Jun-03 0:31
geo_m1-Jun-03 0:31 
QuestionCan I get the thread ID of a thread of same application Pin
Mahesh Perumal31-May-03 2:45
Mahesh Perumal31-May-03 2:45 
AnswerRe: Can I get the thread ID of a thread of same application Pin
valikac31-May-03 7:08
valikac31-May-03 7:08 
GeneralRe: Can I get the thread ID of a thread of same application Pin
Mahesh Perumal1-Jun-03 4:13
Mahesh Perumal1-Jun-03 4:13 
Generalerror : No cursor name available Pin
modular31-May-03 2:29
modular31-May-03 2:29 
GeneralRe: error : No cursor name available Pin
PJ Arends31-May-03 10:33
professionalPJ Arends31-May-03 10:33 
GeneralreLook into your Memory Pin
wavewave31-May-03 2:22
wavewave31-May-03 2:22 
GeneralRe: reLook into your Memory Pin
Vikram A Punathambekar31-May-03 9:05
Vikram A Punathambekar31-May-03 9:05 
Questionis it possible to run an app in user PC throught internet? Pin
includeh1031-May-03 2:18
includeh1031-May-03 2:18 
AnswerRe: is it possible to run an app in user PC throught internet? Pin
ZoogieZork31-May-03 3:14
ZoogieZork31-May-03 3:14 
GeneralFixing size of a folder Pin
rohit.dhamija31-May-03 0:40
rohit.dhamija31-May-03 0:40 
GeneralRe: Fixing size of a folder Pin
valikac31-May-03 7:09
valikac31-May-03 7:09 
GeneralRe: Fixing size of a folder Pin
Anonymous1-Jun-03 1:06
Anonymous1-Jun-03 1:06 
GeneralIs void main() a legal C++ statement? Bjarne Stroustrup says it's not. Pin
Link260031-May-03 0:22
Link260031-May-03 0:22 
GeneralRe: Is void main() a legal C++ statement? Bjarne Stroustrup says it's not. Pin
ZoogieZork31-May-03 1:36
ZoogieZork31-May-03 1:36 
GeneralRe: Is void main() a legal C++ statement? Bjarne Stroustrup says it's not. Pin
Michael Dunn31-May-03 5:49
sitebuilderMichael Dunn31-May-03 5:49 
GeneralNo (NT) Pin
Mike Nordell31-May-03 18:53
Mike Nordell31-May-03 18:53 

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.