• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

Archived

This topic is now archived and is closed to further replies.

TotalCoder

Any C++ newbie or wants to learn pls read

19 posts in this topic

Hi, Anyone interested in learning C++ please take a look at my tutorial and let me know what more I can change or add so that it better targets the novice. This tutorial is geared towards the complete novice and shows them how to get Borland C++ 5.5 up and running on the Windows platform. I would really appreciate your feedback. Please goto http://www.totalcoder.com and look at the Borland C++ 5.5 tutorial, and either post your comments and/or suggestions here or on the site. Sam ----- TotalCoder http://www.totalcoder.com "Resources, tutorials, and articles for the novice, part-time, and hobbyist programmer"
0

Share this post


Link to post
Share on other sites
You have a typo on your #include line (the less than and greater than). Use < and > for less than and greater than symbols, respectively. C++ compliance issues: You should be including iostream, not iostream.h; you should also use std::cout instead of cout if you do that (or put "using namespace std" in there somewhere). Somehow I doubt you should debate whether C or C++ is better in a compiler related tutorial, but to each his own I guess.

[Resist Windows XP''s Invasive Production Activation Technology!]
0

Share this post


Link to post
Share on other sites
Hi Sam,
Nice one. The tutorial is OK so far. One thing I''d suggest is a few screen shots of what you should actually see as you''re going through the process. I know it might sound a bit mickey mouse, but when youre just getting started youre very unsure of yourself...
Jon
0

Share this post


Link to post
Share on other sites
Thanks let me make those revisions, and the screen shot ideal is a good one. I forgot about the C++ compliance issues, since Visual C++ breaks a lot of them. They always include #include it made me forget it is #include .

Also with C++ header files should be named with .hpp extension. Let me get a rewrite and I''ll repost, did you find it helpful for the newbies?



Sam
-----
TotalCoder
http://www.totalcoder.com
"Resources, tutorials, and articles for the novice, part-time, and hobbyist programmer"
0

Share this post


Link to post
Share on other sites
Null and Void,

I was trying not to debate whether C or C++ is better, I''m sorry it came off that way. I was merely trying to inform the reader on why I was using C++, but if it may be confusing for the newbie I''ll remove it.

Sam
-----
TotalCoder
http://www.totalcoder.com
"Resources, tutorials, and articles for the novice, part-time, and hobbyist programmer"
0

Share this post


Link to post
Share on other sites
void main is not valid C or C++. Using void to indicate an empty parameter list is not recommended in C++.

Psalm 137:9: "Happy shall he be, that taketh and dasheth thy little ones against the stones."
0

Share this post


Link to post
Share on other sites
quote:
Original post by Arild Fines
Using void to indicate an empty parameter list is not recommended in C++.

you mean
int SomeFunc(void) { ... }; 

right?
why not? i thought that was good form...

--- krez (krezisback@aol.com)
0

Share this post


Link to post
Share on other sites
Well for an explanation on why void main... is improper here is a direct quote from Bjarne on his site. Also, I am busily incorporating these changes and everything else into the first tutorial. Thanks again everyone!

quote:

Can I write "void main()"?
The definition
void main() { /* ... */ }

is not and never has been C++, nor has it even been C. See the ISO C++ standard 3.6.1[2] or the ISO C standard 5.1.2.2.1. A conforming implementation accepts
int main() { /* ... */ }

and
int main(int argc, char* argv[]) { /* ... */ }

A conforming implementation may provide more versions of main(), but they must all have return type int. The int returned by main() is a way for a program to return a value to "the system" that invokes it. On systems that doesn''t provide such a facility the return value is ignored, but that doesn''t make "void main()" legal C++ or legal C. Even if your compiler accepts "void main()" avoid it, or risk being considered ignorant by C and C++ programmers.
In C++ main() need not contain an explicit return statement. In that case, the value returned is 0, meaning successful execution. For example:

#include

int main()
{
std::cout << "This program returns the integer value 0\n";
}

Note also that neither ISO C++ nor C99 allows you to leave the type out of a declation. That is, in contrast to C89 and ARM C++ ,"int" is not assumed where a type is missing in a declaration. Consequently:
#include

main() { /* ... */ }

is an error because the return type of main() is missing.



Sam
-----
TotalCoder
http://www.totalcoder.com
"Resources, tutorials, and articles for the novice, part-time, and hobbyist programmer"
0

Share this post


Link to post
Share on other sites
I''ll give it a try, do you have a link? If not, I''ll pull it down from Google. But thanks for the information, that is what I''m looking for, before Borland, all I new was LCC, GCC, Borland, and, for work, I use MS Visual C++.

But since I''m targeting novices and hobbyist I don''t want to include VC++ from the beginning because most non-students can''t afford it. But I''ll look into Dev C++, does it have a color syntaxing IDE? I hate coding in Notepad because I don''t remember half the keywords! MS Visual C++ has spoiled me and it looks as if it has hidden many important constructs from me as well such as int main() etc... Since coding in C++ and using MFC I haven''t seen a MAIN function in eons.

Sam
-----
TotalCoder
http://www.totalcoder.com
"Resources, tutorials, and articles for the novice, part-time, and hobbyist programmer"
0

Share this post


Link to post
Share on other sites
I personally use void to indicate an empty parameter list in C++ too, I think it makes it more clear (maybe because I do a whole lot of C programming too?).
quote:
Original post by TotalCoder
I''ll give it a try, do you have a link?

Bloodshed.net.
quote:
Original post by TotalCoder
But I''ll look into Dev C++, does it have a color syntaxing IDE?

Yes. It''s a lot like MSVC.

[Resist Windows XP''s Invasive Production Activation Technology!]
0

Share this post


Link to post
Share on other sites
quote:
Original post by krez
you mean
int SomeFunc(void) { ... };  

right?
why not? i thought that was good form...


I dont recommend it - ergo its not recommended.



Fantastic doctrines (like Christianity or Islam or Marxism) require unanimity of belief. One dissenter casts doubt on the creed of millions. Thus the fear and hate; thus the torture chamber, the iron stake, the gallows, the labor camp, the psychiatric ward - Edward Abbey
0

Share this post


Link to post
Share on other sites
Null - nope. The standard explicitly states that if you exit main without returning a value, the effect will be that of returning 0.

(VC++ 6.0 doesnt work that way, tho)

Fantastic doctrines (like Christianity or Islam or Marxism) require unanimity of belief. One dissenter casts doubt on the creed of millions. Thus the fear and hate; thus the torture chamber, the iron stake, the gallows, the labor camp, the psychiatric ward - Edward Abbey
0

Share this post


Link to post
Share on other sites
quote:
Original post by Arild Fines
I dont recommend it - ergo its not recommended.


yes, i figured that out the first time you said "it''s not recommended"... but, what i meant to ask was: is there a reason for this, or is it a personal taste thing?
0

Share this post


Link to post
Share on other sites
Sure there is a reason for it: I dont do it this way, and everybody should do things exactly the same way I do them.

Fantastic doctrines (like Christianity or Islam or Marxism) require unanimity of belief. One dissenter casts doubt on the creed of millions. Thus the fear and hate; thus the torture chamber, the iron stake, the gallows, the labor camp, the psychiatric ward - Edward Abbey
0

Share this post


Link to post
Share on other sites
Thanks everyone for all your posts, critique, and recommendation. I appreciate everything that you have written. I have included everyone that has contributed to the tutorial in the additional credit section of the article, if any of you want your email or other names attached to it, let me know.

I''m working on the next tutorial which will combine input and outpout mostly cin and cout so that the reader can do some interactive stuff.



Sam
-----
TotalCoder
http://www.totalcoder.com
"Resources, tutorials, and articles for the novice, part-time, and hobbyist programmer"
0

Share this post


Link to post
Share on other sites
Should there be a return 0 statement? Here is a quote from the Bjarne Style FAQ I found on the web.

quote:

In C++ main() need not contain an explicit return statement. In that case, the value returned is 0, meaning successful execution...



The return value is impled and 0 is returned.

Sam
-----
TotalCoder
http://www.totalcoder.com
"Resources, tutorials, and articles for the novice, part-time, and hobbyist programmer"
0

Share this post


Link to post
Share on other sites
Bjarne is absolutely correct, as I have pointed out earlier in this thread. Read the standard regarding the main function, section 3.6.2, I think(something like that, anyway - I dont have it here right now).
The main problem is that VC++ gives you a warning when exiting main without an explicit return statement, and since VC++ is the compiler ''everyone'' uses, people think this is they way its supposed to be.

Fantastic doctrines (like Christianity or Islam or Marxism or Microsoft-bashing) require unanimity of belief. One dissenter casts doubt on the creed of millions. Thus the fear and hate; thus the torture chamber, the iron stake, the gallows, the labor camp, the psychiatric ward - Edward Abbey
0

Share this post


Link to post
Share on other sites