ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Other Software > Developer's Corner

c++ resources for the VB programmer

(1/3) > >>

Booma-Booma:
Hi all,
I was wondering if any of you could point me to some specific resources about c++ geared towards a VB programmer?

For example, in VB this works as expected:

if x = 6 then....

However in c++:
If (x=6) ....

Doesn't work as I would have expected (coming from a VB background). It took me some time to figure it out. It actually assigns the value of 6 to x. I won't make that mistake again!

In c++ if you declare a variable:

int x;

and then do something like this:
x++;
cout << x;

I get some weird number. I figured that x is being initialized to some random number. Is there any way to have int default initial value = 0?

I am using Dev-c++ for an ide and was wondering how can I set break points so that I can trace through and inspect variable values? I guess what I am getting at is, is there a facility to run programs similar to the way VB does? Or should I just change my mind set?

Cheers,
Troy

Eóin:
I would almost suggest getting a beginners book to C++ and forgetting about what you've learned from VB initially. Once you get past learning the syntax then all your VB knowledge will really stand to you, but initially it could be just confusing because of the subtle differences like those two you've pointed out.

Booma-Booma:
I would almost suggest getting a beginners book to C++ and forgetting about what you've learned from VB initially. Once you get past learning the syntax then all your VB knowledge will really stand to you, but initially it could be just confusing because of the subtle differences like those two you've pointed out.
-Eóin (February 04, 2007, 09:02 AM)
--- End quote ---

Eóin, you make a good point! I do have a beginners book on c++ and am reading it. I was just wondering if anybody had heard of specific resources that would help a VB program unlearn bad habits  ;). For the last year or so I was getting into the .net thing. But I am realizing there are far more resources out there for c++ then VB. The other thing that I really like is the potential for cross-platform programing, that would be awesome!

Cheers,
Troy

Eóin:
If you're coming from VB.net then C# could be a wiser option. It's still got the whole ".net thing" but also it is proving to be quite popular so there'd be a lot of resources out there.

That said I'm a C++ programmer myself, and really love the language so I am certainly not discouraging you away from it, but there is no harm in looking into other options :) .

mouser:
I agree with Eoin, not only might c# be a better match, but it's a more modern and "pure" language that will likely teach you better habits  (ironically this advice is again coming from a c++ coder).

Navigation

[0] Message Index

[#] Next page

Go to full version