|
forexsurfr wrote: Secondly, what is the most recommended learning path.
There's no secret: learning to be a good programmer is like learning to be a good musician. It comes from practising, a lot. Work on different kind of projects, by starting to work with people that have more experience than you and will be able to guide you. Looking at code developped by others and trying to understand it also helps a lot.
|
|
|
|
|
My first bit of advice is don't use that Deitel book. It was the recommended text for a module of an MSc course I did a couple of years ago and it was truly appalling. I'd also be wary of Stephen Prata's book. I am a fan of his "C primer" (I learnt C from it years ago) but his C++ book was too much like the C book to avoid confusing people.
I'd recommend "Programming -- Principles and Practice Using C++" by Bjarne Stroustrup, it's a lot better introduction to C++ and programming in general. If you already know a programming language then "Accelerated C++" by Koenig and Moo is pretty good. I've seen five people now successfully use "Accelerated C++" to become effective fairly quickly with self study.
Cheers,
Ash
|
|
|
|
|
forexsurfr wrote: Secondly, what is the most recommended learning path.
Start coding. Do it a lot, have fun and also talk with other coders. Sooner or later you will see it's a team sport.
|
|
|
|
|
forexsurfr wrote: I am learning C++ and would like to find out from the veterans out there what is the most efficient way of learning this language.
By using it.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Thank you everybody for your help and direction.
|
|
|
|
|
Ivor Horton has a good book on Visual C++ 2008.
He teaches C++ in the first half of the book and Windows Programming in the second half. He's still uses MFC for most of the book (which is a good thing IMO) but he has adapted and incorporated WinForms and some managed code for those who want it.
I've been very impressed with his teaching style and his choice of topics to cover.
|
|
|
|
|
I have to say the way I learned C++ was thru the Horton's book already mentioned. I started with version 6 of his and worked thru 2005 etc. Very good book. However, if you are not a good book-learner type of person I highly recommend a continuing education class. I took a certificate program thru a local university that was 2 years long after all the classes were gone thru and it proved very very valuable having someone to bounce things off of like an experienced instructor ( in addition to homework and tests!). I think you can prevent learning bad habits that way....
michael judy
m_judy@hotmail.com
"According to my calculations there is no problem"
|
|
|
|
|
Do not use any of the Microsoft code samples as examples of good coding.
Once you agree to clans, tribes, governments...you've opted for socialism. The rest is just details.
|
|
|
|
|
Seconded.
Many of the MS examples involve using the windows library, or worse, MFC. And these are still full of bad code, such as global #defines that mess up your code with no identifyable error message, and conflicting type definitions ('Handle' anyone?). In the end half the problems you'll encounter will be caused by MS stuff and not by your lack of understanding C++!
Best way to start learning is avoid windows programming and instead do a few command line applications.
Personally I never really used a book to learn C++, mostly because at the time I started there weren't any (more to the point, the language was still in development and I was using a precompiler that converted C++ code into C before starting the actual compiler).
If I were to recommend a book to buy, it would be "The C++ Programming Language" by Bjarne Stroustrup. Considering that it is not exactly named to be a learning book, it does contain very good explanations of the mechanisms, lots of examples, and at the end of each chapter there is a list of exercises that you can do. The nice thing about the book is that after almost 30 years of C++ programming I can still find useful advice or examples inside whenever I dig into some of the less familiar constructs (e. g. virtual inheritance or template specialization).
|
|
|
|
|
Stefan63 wrote: the language was still in development and I was using a precompiler that converted C++ code into C before starting the actual compiler
Been there, done that. Weren't the 80s fun? Not only no debugger, you had to figure out if it was your bug or the way the translator was mangling your C++ code into C or a bug in the C compiler.
Once you agree to clans, tribes, governments...you've opted for socialism. The rest is just details.
|
|
|
|
|
Hi!
I've to convert a wide char string to tolower. This the code I used.
s32 id = profileList->getSelected();
stringw strtoDelete = profileList->getListItem(profileList->getSelected());
if(!strcmp(reinterpret_cast<const char*>(tolower(strtoDelete.c_str())),reinterpret_cast<const char*>("default")))
{
profileList->removeItem(id);
}
But I got the following errors:
Error 5 error C2143: syntax error : missing ')' before '{' d:\goldminer\source\game\gamemenuprofilestate.cpp 237
Error 4 error C2661: 'strcmp' : no overloaded function takes 1 arguments d:\goldminer\source\game\gamemenuprofilestate.cpp 236
Error 3 error C2664: 'tolower' : cannot convert parameter 1 from 'const wchar_t *' to 'int' d:\goldminer\source\game\gamemenuprofilestate.cpp 236
7 IntelliSense: argument of type "const wchar_t *" is incompatible with parameter of type "int" d:\goldminer\source\game\gamemenuprofilestate.cpp 236
How to convert a wide char string to tolower?
|
|
|
|
|
|
Hi!
Is there any single function for string<wchar_t> which works like tolower?
|
|
|
|
|
C99 defines a towlower which converts a single character. There's an implementation in VC++ from at 2003 onwards. You can use that with std::transform to convert a wide string to lowercase.
Cheers,
Ash
PS: Most of the time when you're having to use reinterpret_cast to shut the compiler up there's something a bit wrong with your code. Using strcmp is usually an additional signal, especially when you're using it with C++ style strings.
PPS: Just out of interest why are you trying to compare a C++ wide string to a narrow C string? Wouldn't it be far easier to just say:
if( strToDelete == L"default" )
{
}
or am I missing something fundamental here?
|
|
|
|
|
Not only: using reinterpret_cast to convert a pointer to C-style unicode string to a pointer to C-style ANSI string simply produces crashes or wrong results. To convert from unicode to ANSI or viceversa there are specific functions!
|
|
|
|
|
Why not use _wcsicmp[^]?
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
wstring strtoDelete = ............
wstring szDefault = L"default";
if(!_tcscmp(reinterpret_cast<const TCHAR*>(_tcslwr(strtoDelete.c_str())), szDefault.c_str()))
{
....
}
Sameer();
|
|
|
|
|
|
Moak wrote: Somebody knows what it tries to do while "checking for a solution"? Is Windows sending information to Microsoft without users' consent?
Have a look at:
Does "Windows is checking for a solution..." actually do anything?.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Thanks for the info! Looks like Microsoft Windows is massively phoning home, no user information, obsolete privacy statements (via control panel)... scary.
|
|
|
|
|
What is the difference between CreateWindow and CreateWindowEx?
I know of the extra functionality provided by using the CreateWindowEx, but is their any difference in performance.
Is my program missing out on any other speed or interaction functionality by using the older CreateWindow function?
|
|
|
|
|
Calling CreateWindow will internally call CreateWindowEx .
I confirmed this using Windbg.
|
|
|
|
|
difference is,later function takes one extra parameter.
Actually, CreateWindow is a macro, expanding to CreateWindowEx with NULL(no extended style) as first parameter.
In effect you are using only one function.
|
|
|
|
|
What does this mean? Does the 64 bit machine use 32 bit arithmetic for such a project?
thanks
|
|
|
|
|
You can run 32 bit on 32 or 64 bit machine.
However 64 bit has to run on a 64 bit machine ONLY!
|
|
|
|