|
You last visited: Today at 08:57
Advertisement
Programming for Idiots (Tutorial) C++
Discussion on Programming for Idiots (Tutorial) C++ within the CO2 Programming forum part of the Conquer Online 2 category.
05/04/2009, 01:43
|
#1
|
elite*gold: 20
Join Date: Jan 2008
Posts: 2,012
Received Thanks: 2,885
|
Programming for Idiots (Tutorial) C++
Yeah, so in my relation to my C# one (  ), which wasn't the best I felt I'll *try* make for it with this one. I've also got some spare time in between school, from when exams start, and a new Warlords server comes out... so yeah.
Right, so before I post any links to the videos I'd like to point out, so I don't get bitched at by people saying, "this isn't real C++", most of the things I do will be Win32 API C++. This means (most of) my code(s), and things I'll demonstrate will be Microsoft/Windows specific and will not run on OS's such as Mac (Dunno if it'd run on an OSX), or Linux, etc.
Megaupload doesn't work for you? Tough luck, get someone else to download it, and send it to you.
Feel free to ask questions.
Errata
Lesson 1 & 2 Errors -
Lesson one - Introduction & Variable Types:
Lesson two - Console I/O
|
|
|
05/04/2009, 12:05
|
#2
|
elite*gold: 20
Join Date: Jun 2005
Posts: 1,013
Received Thanks: 381
|
Few comments.
In the first video, you discuss chars and wide chars being ANSI and Unicode. This isn't strictly true. wchar_ts themselves don't represent any particular character set, only the storage size of what's being used (in this case, the size of an unsigned short.)
ANSI and Unicode aren't exactly character sets anyway. One is a standards commitee, the other is a standard.
While "ANSI" is the default character encoding on the majority of Windows machines, it certainly isn't reasonable to use >128 latin characters. (especially since char is signed by default unless /J is supplied). I think a more reasonable description would be to say, chars support ASCII, but the remaining 128 values that can be held in it, are completely dependant on choice of character set (the default one is system dependant.) In other words, a char doesn't necessarily support european/accented characters (use a wchar instead to be sure.)
Unicode is the standard that covers the character sets UTF-8, UTF-16, UTF-32. UTF-8 would be the de-facto standard one, what you probably mean by the term Unicode. It works as ASCII for the first 128 characters (1 byte each), but if the highest bit in that byte is set, it will use a second character too. (ie, UTF-8 is a mix of 1 and 2, 3 or 4 byte characters). A wchar doesn't necessarily cover everything in it.
In addition to char_t and wchar_t, you can create your own, of any size. (These two are just typedefs of basic_char<T>.)
Also, in one of other vids, you mention C++ ATL. I think you mean the C++ STL (Standard Template Library). ATL is something else. Also, it wouldn't've really been an MS employee who decided to use "std", it would be the folks at ISO.
(Don't they call them STIs nowadays anyway?)
You didn't mention to #include <stdio.h> (or cstdio.h), to enable the use of printf, gets etc. I dunno whether this is included in stdafx already.
I'm not a fan of the way you make out stdafx.h to be "required" too. It's there to reduce compilation time, but I often find it more hassle to use a PCH.
Anyway, overall pretty good. I was expceting a fair few "mistakes" before watching, but you went on to mention everything needed.
|
|
|
05/04/2009, 21:22
|
#3
|
elite*gold: 20
Join Date: Jan 2008
Posts: 2,012
Received Thanks: 2,885
|
Quote:
Originally Posted by unknownone
Few comments.
In the first video, you discuss chars and wide chars being ANSI and Unicode. This isn't strictly true. wchar_ts themselves don't represent any particular character set, only the storage size of what's being used (in this case, the size of an unsigned short.)
ANSI and Unicode aren't exactly character sets anyway. One is a standards commitee, the other is a standard.
While "ANSI" is the default character encoding on the majority of Windows machines, it certainly isn't reasonable to use >128 latin characters. (especially since char is signed by default unless /J is supplied). I think a more reasonable description would be to say, chars support ASCII, but the remaining 128 values that can be held in it, are completely dependant on choice of character set (the default one is system dependant.) In other words, a char doesn't necessarily support european/accented characters (use a wchar instead to be sure.)
Unicode is the standard that covers the character sets UTF-8, UTF-16, UTF-32. UTF-8 would be the de-facto standard one, what you probably mean by the term Unicode. It works as ASCII for the first 128 characters (1 byte each), but if the highest bit in that byte is set, it will use a second character too. (ie, UTF-8 is a mix of 1 and 2, 3 or 4 byte characters). A wchar doesn't necessarily cover everything in it.
In addition to char_t and wchar_t, you can create your own, of any size. (These two are just typedefs of basic_char<T>.)
Also, in one of other vids, you mention C++ ATL. I think you mean the C++ STL (Standard Template Library). ATL is something else. Also, it wouldn't've really been an MS employee who decided to use "std", it would be the folks at ISO.
(Don't they call them STIs nowadays anyway?) Yes, your right I did mean STL, thanks for catching this. They *should* be called STIs nowadays, but everyone still calls them STDs, at least, where I live.
You didn't mention to #include <stdio.h> (or cstdio.h), to enable the use of printf, gets etc. I dunno whether this is included in stdafx already.
I'm not a fan of the way you make out stdafx.h to be "required" too. It's there to reduce compilation time, but I often find it more hassle to use a PCH.
The VC++ Compiler requires stdafx.h to be included in all .cpp files, unlike other compiles, such as Dev-Cpp. However I'll mention this in my errata, thanks.
Anyway, overall pretty good. I was expceting a fair few "mistakes" before watching, but you went on to mention everything needed.
|
Thanks for the insight, as you know, I'm not nearly as experienced with C++ as you are. I'll reupload the videos with an errata in a text file.
|
|
|
05/04/2009, 23:00
|
#4
|
elite*gold: 0
Join Date: Feb 2008
Posts: 1,590
Received Thanks: 154
|
haha double d.
|
|
|
05/05/2009, 00:33
|
#5
|
elite*gold: 0
Join Date: Feb 2007
Posts: 1,366
Received Thanks: 256
|
Quote:
Originally Posted by InfamousNoone
Yeah, so in my relation to my C# one (  ), which wasn't the best I felt I'll *try* make for it with this one.
|
Love it, I'm gonna use it - do you have plans on finishing your C# series? I liked those.
|
|
|
06/07/2009, 03:00
|
#6
|
elite*gold: 0
Join Date: Jun 2007
Posts: 20
Received Thanks: 0
|
Wow, someones gunna laugh at me for asking this... I've only seen video one so far, and i was wondering.. When your done the project thingy, does that become the source? Or is the source actualy a microsoft visual C++ file? this is my first step into coding >_<
|
|
|
06/07/2009, 11:39
|
#7
|
elite*gold: 0
Join Date: Feb 2007
Posts: 348
Received Thanks: 2,175
|
A really nice way to learn to program that worked for me when i was young was to read other peoples source code line by line and try to understand how it works. Then i would rewrite the code line by line better gather an understanding, then I would make changes to it to see what happens. Kinda like running experiments.
Its a really fast way to learn if anyone wants to try it.
Chow
|
|
|
06/07/2009, 14:39
|
#8
|
elite*gold: 0
Join Date: Jul 2006
Posts: 88
Received Thanks: 0
|
Quote:
Originally Posted by clintonselke
A really nice way to learn to program that worked for me when i was young was to read other peoples source code line by line and try to understand how it works. Then i would rewrite the code line by line better gather an understanding, then I would make changes to it to see what happens. Kinda like running experiments.
Its a really fast way to learn if anyone wants to try it.
Chow 
|
i do that before i think it's best way to good learn but most projects now without source code so i try learn step by step , i was learn make tools like "Co Yeti" when yeti post his source code and he was good teacher he answer for all my asks and helps me more until i can make his tools by self and edit it for any patches , i hope he back again
|
|
|
06/07/2009, 14:58
|
#9
|
elite*gold: 0
Join Date: Jul 2006
Posts: 88
Received Thanks: 0
|
Quote:
Originally Posted by InfamousNoone
Yeah, so in my relation to my C# one (  ), which wasn't the best I felt I'll *try* make for it with this one. I've also got some spare time in between school, from when exams start, and a new Warlords server comes out... so yeah.
Right, so before I post any links to the videos I'd like to point out, so I don't get bitched at by people saying, "this isn't real C++", most of the things I do will be Win32 API C++. This means (most of) my code(s), and things I'll demonstrate will be Microsoft/Windows specific and will not run on OS's such as Mac (Dunno if it'd run on an OSX), or Linux, etc.
Megaupload doesn't work for you? Tough luck, get someone else to download it, and send it to you.
Feel free to ask questions.
|
good learn i start with u
|
|
|
09/02/2009, 12:48
|
#10
|
elite*gold: 0
Join Date: Jul 2006
Posts: 2,216
Received Thanks: 794
|
Bumping, looking forward on this one
|
|
|
09/02/2009, 16:40
|
#11
|
elite*gold: 0
Join Date: May 2008
Posts: 259
Received Thanks: 94
|
rofl double d xD
|
|
|
09/02/2009, 18:45
|
#12
|
elite*gold: 20
Join Date: Jan 2008
Posts: 1,042
Received Thanks: 252
|
Quote:
Originally Posted by ElDeRnEcRo
Bumping, looking forward on this one
|
Hybrid says he has no intention to finish these, epvp is a lost cause
|
|
|
09/02/2009, 20:48
|
#13
|
elite*gold: 0
Join Date: Jul 2006
Posts: 2,216
Received Thanks: 794
|
Quote:
Originally Posted by © Haydz
Hybrid says he has no intention to finish these, epvp is a lost cause 
|
IMO He should finish them anyway and post it somewhere else for those still interested :P
|
|
|
09/04/2009, 06:39
|
#14
|
elite*gold: 20
Join Date: Jan 2008
Posts: 1,042
Received Thanks: 252
|
I myself am still interested, im not efficient with c++, i still have to use msdn for alot of functions and libs
|
|
|
02/09/2012, 00:21
|
#15
|
elite*gold: 0
Join Date: Mar 2011
Posts: 78
Received Thanks: 8
|
rapidshare plz cuz mega is down
|
|
|
Similar Threads
|
Programming For Idiots (Tutorial) - In C#
05/25/2013 - CO2 Programming - 188 Replies
This tutorial has been superseded by: http://www.elitepvpers.com/forum/co2-programming/88 5939-programming-idiots-c-take-2-a.html
Well for the next week (or so) due to being bored, I've started a video-tutorial called C# Programming for Idiots and yeah, by the end of it I'll demonstrate how to make a conquer server (patch 5016 and before) without the need of mysql, or anything like that; all you need is the Visual C# compiler, and WinRAR (To extract the videos).
Visual C# Compiler:...
|
[RE-OPENING]"Programming For Idiots (Tutorial) - In C#"
09/17/2009 - CO2 Programming - 20 Replies
At start i want to say THIS IS NOT MY GUIDE , GUIDE WAS MADE BY INFAMOUSNONE!!
|
All times are GMT +1. The time now is 08:59.
|
|