Valhalla Legends Forums Archive | General Programming | Starting my journey through the lands of C++!

AuthorMessageTime
Crypticflare
So far all I've read of it was the first 3-4 chapters, but I must say I'm really enjoying it, with VB I was like "bah another chapter to read", but this stuff seems real cool. So uh thank you (All of the board members) that have given advice over the few months I been here! I'll be gladly posting questions that confuse me soon!
May 17, 2003, 12:25 PM
drake
wait until you see how much faster C++ programs run too. Yet you will still end up with like 20 errors and 60 warnings during compiles.
May 19, 2003, 12:08 AM
Yoni
I doubt it'll run any faster if the compiler encounters 20 errors and 60 warnings.
May 19, 2003, 12:45 AM
iago
Maybe if you just delete the 20 lines that have errors on them and leave the other 60 lines intact then life will be good..?
May 19, 2003, 5:47 AM
drake
I like my technique. I just say F it and stop working on it all together when I get too many errors.
May 19, 2003, 6:37 AM
Noodlez
[quote author=drake link=board=5;threadid=1357;start=0#msg10243 date=1053326237]
I like my technique. I just say F it and stop working on it all together when I get too many errors.
[/quote]
What an excellent way to waste time, and not learn a damn thing.
May 19, 2003, 6:56 AM
Zakath
Indeed. Warnings are warnings - they are an attempt to let you know that something may go wrong. However, it's not always necessary to listen to them. On the other hand, errors must be fixed, and it's really not very hard to fix them.

[quote]------ Build started: Project: ZakBot1, Configuration: Release Win32 ------

Compiling...
ZakBot.cpp
ZakBot.cpp(96) : warning C4244: 'return' : conversion from 'WPARAM' to 'int', possible loss of data
ZakBot.cpp(105) : warning C4311: 'type cast' : pointer truncation from 'LRESULT (__stdcall *)(HWND,UINT,WPARAM,LPARAM)' to 'long'
ZakBot.cpp(105) : warning C4312: 'type cast' : conversion from 'LONG' to 'WNDPROC' of greater size
ZakBot.cpp(141) : warning C4311: 'type cast' : pointer truncation from 'HBRUSH' to 'BOOL'
ZakBot.cpp(146) : warning C4311: 'type cast' : pointer truncation from 'HBRUSH' to 'BOOL'
ZakBot.cpp(151) : warning C4311: 'type cast' : pointer truncation from 'HBRUSH' to 'BOOL'
ZakBot.cpp(413) : warning C4267: 'argument' : conversion from 'size_t' to 'DWORD', possible loss of data
ZakBot.cpp(416) : warning C4267: 'argument' : conversion from 'size_t' to 'DWORD', possible loss of data
ZakBot.cpp(419) : warning C4267: 'argument' : conversion from 'size_t' to 'DWORD', possible loss of data
ZakBot.cpp(422) : warning C4267: 'argument' : conversion from 'size_t' to 'DWORD', possible loss of data
ZakBot.cpp(425) : warning C4267: 'argument' : conversion from 'size_t' to 'DWORD', possible loss of data
ZakBot.cpp(428) : warning C4267: 'argument' : conversion from 'size_t' to 'DWORD', possible loss of data
ZakBot.cpp(441) : warning C4267: 'argument' : conversion from 'size_t' to 'DWORD', possible loss of data
ZakBot.cpp(551) : warning C4244: 'initializing' : conversion from 'LRESULT' to 'int', possible loss of data

Build log was saved
ZakBot1 - 0 error(s), 14 warning(s)


---------------------- Done ----------------------

Build: 1 succeeded, 0 failed, 0 skipped[/quote]

A fair number of warnings, but none of them affect the functionality of the program (that's not to say those particular warnings should always be ignored!).
May 19, 2003, 5:41 PM
drake
well I was joking...
May 20, 2003, 2:30 AM
iago
You really should just use size_t's for size variables, but it doesn't really matter.
May 20, 2003, 5:48 AM
Grok
[quote author=iago link=board=5;threadid=1357;start=0#msg10275 date=1053409730]
You really should just use size_t's for size variables, but it doesn't really matter.
[/quote]

ASSERT( size_t counts );
May 20, 2003, 11:02 AM
EvilCheese
Also, you'll come to realise that "60 errors" doesnt necessarily mean "60 things wrong with your code".

In some situations you can fix 30 errors just by adding/modifying one line, or repositioning a single semicolon... though that's usually when your errors are caused by an oversight rather than a basic flaw in logic.

If you throw away a whole project just cuz of a missing #include line in a class declaration header, you'll kick yourself later :P
May 20, 2003, 11:03 AM
EvilCheese
[quote author=Grok link=board=5;threadid=1357;start=0#msg10279 date=1053428548]
[quote author=iago link=board=5;threadid=1357;start=0#msg10275 date=1053409730]
You really should just use size_t's for size variables, but it doesn't really matter.
[/quote]

ASSERT( size_t counts );
[/quote]

Grok, that was painful :P

I'm embarrased to admit that I actually laughed out loud ;)
May 20, 2003, 11:06 AM
Zakath
[quote author=iago link=board=5;threadid=1357;start=0#msg10275 date=1053409730]
You really should just use size_t's for size variables, but it doesn't really matter.
[/quote]

Note that they said "argument." The conversion was taking place where variables of type size_t were being passed into functions in place of DWORDs. Had nothing to do with any variables I may or may not have declared as size_t.
May 20, 2003, 2:29 PM

Search