• 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.
Sign in to follow this  
Followers 0

LCTHW, opinions & a question!

4 posts in this topic


I introduced myself couple of days ago.

I've been recommended to use The C Programming Language book, but I plan to use it later on since I've already started with something else. That something else is the Zed Shaw "tutorial", Learn The Hard Way.

I don't know if you guys know it but I'd like to know what's your opinion about it.

I used it to learn Python too, alongside with Invent Your Own Games With Python tutorial, and it worked, but for C I'm finding it harder, I suppose it has to be with C harder nature!

Apart from that I have another question, but since it's language-related and not game-related I hope I'm not doing wrong.

[b]What is the difference between a pointer and a variable?[/b] As far as I've seen the uses of pointers in the tutorial I told you, they seem to work the same way. In the tuto he mentions something about bigger amounts of info, maybe I should get to structs (i don't know yet what that is :D) to understand it better? Some light over the matter would be very much appreciated!

Thanks in advance and regards!


Share this post

Link to post
Share on other sites
[quote name='frob' timestamp='1354910709' post='5008212']
char a; /* A variable that holds a character */
int b; /* A variable that holds an integer */
MyStruct c; /* A variable that holds a structure */

char * x; /* A variable that points to a character */
int * y; /* A variable that points to an integer */
MyStruct * z; /* A variable that points to a structure */

And just to expand a little on this explanation, a pointer is just a variable that holds a memory address. Example:

Given the following declaration, the variable 'a' is shorthand for a memory address that contains the value 5.

int a = 5;

During execution, the value 5 is read directly from the address to which 'a' refers. Like in this case.

int a1 = a;

Here, the value stored at the location represented by 'a' is copied into another address represented by 'a1'. Contrast that with the following pointer declaration, which is going to be interpreted by the compiler in a very different way.

int *b = &a;

'b' is also shorthand for a memory address, but the * tells the compiler to treat it as a pointer, which means that any values found at this address are themselves memory addresses. There are two ways to use a pointer. One is to read the value directly, i.e. the memory address it contains. For example:

int *c = b;

This is saying, take the address stored in b and copy it to c. Both b and c now point to the same thing, in this case 'a' since I assigned its address to b above. And the other is to read the value stored at the address it points to:

int d = *b;

Here, we are reading the address stored in b (the address of a) and then jumping to that address and reading the value there. So, given the assignments above, d will be set to 5.

So pointers are variables, just as non-pointers are. The only difference is that the values they represent are memory addresses rather than integers, characters, or other types. Edited by Aldacron

Share this post

Link to post
Share on other sites
Just hang in there C is actually a quite simple language once you get use to how pointers work. The main reason pointers exist in C is that there is no way to pass data by reference to a function otherwise. In C everything is passed by value (copied). By using Pointers it allows you to pass a memory address to the function so that you don't need to copy that data on being passed. One such example would be passing a integer to a function but you want that function to modify the integer you passed in. Why really depends but often it can be used to return multiple peices of data from a function.

The K&R book (The C Programming Language) Is the best book you can possibly have. I used this book to learn C. It was written by the creators of the language. I have no expierence with Learn C The Hard Way but another great book is C Primer by Prata (same author of the renowned C++ Primer Plus book) C Primer has tons of more pages compaired to the K&R book but it has it's reasons due to the way material is presented. Prata does a great job at going into detail without getting heavily technical which can make it a better book for somone who never programed before.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
Followers 0