Jump to content

  • Log In with Google      Sign In   
  • Create Account

- - - - -

02.01 - The C Language

  • You cannot reply to this topic
22 replies to this topic

#1 Teej   GDNet+   -  Reputation: 176

Like
Likes
Like

Posted 08 April 2001 - 05:53 PM

Why C? There is a distinction that can be made between an algorithm and its implementation. If I tell you how to manually convert Celsius to Fahrenheit, you can write a program that performs this operation in any one of many programming languages, and the end result would be essentially the same. Similarly, if I outlined the technique of scrolling the display, it would be equally as useful regardless of the actual language used. Of course, that’s not to say that any programming language is equally as capable. There are a few common languages that meet the criteria for writing games, and each has its pro’s and con’s. For instance, Visual Basic is touted as a simple and intuitive general-purpose programming language, but it is considered less than ideal when speed is a priority. So why C? The C language is perhaps the most popular programming language, and is used for everything from operating systems to games. And all for good reason – C is blazingly fast, superb in its level of control, and is highly expandable. In my experience, C offers the best compromises for game development. Frankly, I’m not giving you much of a choice. Currently, all code examples in this forum are in C, and that’s for the simple fact that it’s my language of choice. My only point is that it may very well be the best choice regardless. In a nutshell, you can go ahead and apply what’s covered in this forum to any language/platform you wish, but you’re on your own if it’s not in C. C Language Resources There are a couple of places I can direct you to if you’re looking to learn (or continue learning) the C language. If anyone has any other links, please share them with us. www.informit.com contains a few complete online books that teach the C language. And best of all, they’re free! www.cprogramming.com contains a C++ tutorial; much of the information is essentially straight C though… Questions or comments? Please reply to this topic.

Sponsor:

#2 william knight   Members   -  Reputation: 122

Like
Likes
Like

Posted 11 April 2001 - 08:22 AM

i am interested in designing games but i am not interested in programing, what other steps are there for me to take to brake into the industry? I have some graphics design experience (not much) and a little bit of training in photoshop and illustrator as well as being A+ certified. I have thought about enrolling into Digipen, but im not sure if i want to go that route yet.
Also i was wondering what the average saleries of those involved in the production of a game?

#3 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 16 April 2001 - 10:21 AM

C/C++ tutorials from HELL

Any of you with no experience in C/C++ or even in programming, is highly recommended to visit Gordon Dodrill''s site and have a look at his Coronado Enterprise tutorials serie:


Coronado Enterprise homepage


#4 Bifff   Members   -  Reputation: 122

Like
Likes
Like

Posted 16 April 2001 - 10:21 AM

C/C++ tutorials from HELL

Any of you with no experience in C/C++ or even in programming, is highly recommended to visit Gordon Dodrill's site and have a look at his Coronado Enterprise tutorials serie:


Coronado Enterprise homepage

Btw, I'm sorry for the double post. If anybody knows how to delete an anonymous post, just do it, thx.

Edited by - Bifff on April 18, 2001 6:28:54 AM


#5 Grat   Members   -  Reputation: 122

Like
Likes
Like

Posted 21 April 2001 - 04:52 PM

A site i found very useful for a general introduction to the C language was www.howstuffworks.com/c.htm . This site is full of information on everything, so i was suprised to find such a great tutorial on C.

#6 ErrorX   Members   -  Reputation: 122

Like
Likes
Like

Posted 30 April 2001 - 07:55 PM

Well, I don''t know how legal this is, but if someone doesn''t find the given C tutorials sufficient, here are some good books for download:
http://www.psyon.org/archive/e-books/programming/c/index.shtml

Again, moderators: delete this if it''s illegal...(which it probably is)

*** Hi! I''''m a signature virus. Copy me into your signature to help me spread! ***

#7 Xavior   Members   -  Reputation: 122

Like
Likes
Like

Posted 19 May 2001 - 08:43 AM

A bit off topic since we will be focusing on C, but Bruce Eckel offers several Text Books for free, that he sells commercially, on his web site, http://www.mindview.net/Books. His free books include C++, Java, Python and design patterns. These are VERY good books and are used as college text books.

Edited by - Xavior on May 20, 2001 2:24:56 AM

#8 Anakha   Members   -  Reputation: 122

Like
Likes
Like

Posted 22 May 2001 - 09:25 AM

Hi all!

I am a newbie at programming. I followed the link to Informit on the web and found a complete book of Sams - Teach yourself C in 24 hours. I am about halfway in the book. I have also downloaded a few tutorials in C programming to learn how to program in C.

Every tutorial begins with the classical "Hello World" program, that I think you all are familiar with. A program that writes Hello World on the screen. But hey... Why on earth would anyone want to do that? My point is: Why does all tutorials (at least the ones I found) teach you how to do things in DOS? I don´t want to do ANYTHING in DOS! I my opinion, DOS is dead... (Hope I don´t offend anyone...) I just love Windows, whith all those nice OK and Cancel buttons... I want to write my programs in that platform.

I hope you can help me out here. Is there any reason for me att all to continue learning from this book and those tutorials? None of them covers anything about Windows. Sure, I have to learn to crawl before I start to walk, but am I crawling the right direction??? I just don´t want to waste my time... Perhaps I am a little impatient, but hey: That´s just how i am :-)

And secondly, if there isn´t, what do you guys think that I should try with, so I can learn C language in the Windows environment instead of the boring DOS?

The source codes provided that I have seen from some of this forums pages does not contain anything that I have learned from the book or tutorials. Well, maybe a few functions and stuff, but almost everything looks completely unfamiliar to me...

So please friends. Write a few lines of encouragement to me... I really want to learn myself to make applications and games, but I´m feeling lost here.

This is my first post in this forum (except for the Enrolment Roster). Sorry if I write to long. I´ve always had a hard time to get to the point :-)

Hope you can help me. I would appreciate it very much.

Anakha

#9 mhaynes   Members   -  Reputation: 122

Like
Likes
Like

Posted 22 May 2001 - 03:47 PM

Anakha,
I just enrolled too. Andre La''Mothe has an excellent beginning Windows Programming tutorial in his book _Tricks of the Windows Game Programming Gurus_. It basically shows you only what you need to get a full screen "console" running in windows so you can blit pixels and do page flipping, double buffering and all that other fun graphics stuff :-)

#10 Anakha   Members   -  Reputation: 122

Like
Likes
Like

Posted 22 May 2001 - 07:30 PM

Thanx Mhaynes!

Perhaps I will go for the book then. I think books are better than tutorials to give a good foundation to build on. Tutorials seems to be good to refresh things and get other things going when you have a good understanding in the first place.

#11 Weatherman   Members   -  Reputation: 122

Like
Likes
Like

Posted 23 May 2001 - 03:34 AM

quote:

Every tutorial begins with the classical "Hello World" program, that I think you all are familiar with. A program that writes Hello World on the screen. But hey... Why on earth would anyone want to do that? My point is: Why does all tutorials (at least the ones I found) teach you how to do things in DOS? I don´t want to do ANYTHING in DOS! I my opinion, DOS is dead... (Hope I don´t offend anyone...) I just love Windows, whith all those nice OK and Cancel buttons... I want to write my programs in that platform.

I hope you can help me out here. Is there any reason for me att all to continue learning from this book and those tutorials? None of them covers anything about Windows. Sure, I have to learn to crawl before I start to walk, but am I crawling the right direction??? I just don´t want to waste my time... Perhaps I am a little impatient, but hey: That´s just how i am :-)



I can understand why you are impatient! BUT... stick with learning C or C++ before trying to do anything significant with Windows. If you don''t master C or C++ first, you will just be setting yourself up for discouragement and failure.
By the way, C is a programming language and Windows is an operating system (although I agree that there is a little more to it than that). Although you may think that you are programming in DOS, you could be doing almost the exact same thing in UNIX or some other OS.

C (or C++) is an essential foundation for everything that you do in Windows. Believe me (and I speak from many years of experience) you will never regret getting a good foundation in C before tackling Windows code.

#12 Anakha   Members   -  Reputation: 122

Like
Likes
Like

Posted 24 May 2001 - 10:41 AM

Thanx Weatherman!
That´s excatly what I needed! I follow the books and the tutorials, and I think this C stuff is really cool! Now that I know that I eventually will learn more, and that this knowledge will be of great help when I start to learn C in Windows, it feels better to start from the beginning. I will get there someday... I just needed to know that this knowledge is of importance when all of the samples I have seen from Windows programs seem so different from the ones in the book.

But there seems to be so much to learn... All tutorials and books are focusing on different topics. How will I know when I have learned enough to take the step over to the "Windows stuff"?
Will this book I mentioned before be enough or should I practise more? My problem is that I have serious difficulties to see what all keyword, functions, pointers and so on applies to in "the real world" I still feel that the practises and examples are stuff that I probably never will have use of in my own programs. But probably I´m wrong... Thanks again!

Anakha

#13 EbonySeraph   Members   -  Reputation: 122

Like
Likes
Like

Posted 30 June 2001 - 09:56 AM

Hello World is the first program that you make only for tradition. It could also print "My first program" but thats not tradition is it? Also when or if you learned for loops yet the reason why most books or some choose i, j, and k.(j and k if i is taken) is because of tradition too. I think Fortran could only use those variables to count so programmers still continued ot use those variables in C/C++(though you can use any variable names)

About programming in Windows. Programming in Windows requires that you know the Win32 API(Application Programming Interface) which requires that you know how to do things in C or C++ already. You must know how to do things in C before you move on and use things(APIs) that change what GUI(Graphical User Interface - like Windows Explorer or a DOS Prompt) you are programing in.

Also if you start learning Windows programming you will be skipping neccessary skills needed to make useful applications in Windows, you wont always know why something happens, and you will be overwhelmed(maybe). Depending on your pace of learning C(and practice!!! - MAKE programs too!) you could start learning the Win32 API in a month or so.

"Ogun''s Laughter Is No Joke!!!" - Ogun Kills On The Right, A Nigerian Poem.

#14 Adoliir   Members   -  Reputation: 122

Like
Likes
Like

Posted 08 September 2001 - 08:15 PM

"I think Fortran could only use those variables to count so programmers still continued ot use those variables in C/C++(though you can use any variable names)"

Actually, I believe that it''s because variables that start with certain letters are by default integer. This way, you didn''t have to bother with declaring them. That''s why you would see ppl use kandy instead of candy for an integer name, etc.

This sentence is false.

#15 Weatherman   Members   -  Reputation: 122

Like
Likes
Like

Posted 11 September 2001 - 07:11 AM

You are correct. In FORTRAN (at least, the versions current in the ''60s and ''70s), variables that began with i, j, k, l, m, and n were integer variables by default. All other variables were floating point. This could be overridden (if I recall).

#16 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 13 November 2001 - 01:43 PM

can visual c++ do some c

#17 Access   Members   -  Reputation: 100

Like
Likes
Like

Posted 16 January 2002 - 04:34 AM


Whoa!Ebony!


Edited by - Access on March 7, 2002 12:28:59 PM

#18 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 19 March 2002 - 04:21 PM

Anonymous Poster, any C++ compiler, including Visual C++, will accept C code. As C is the basis for C++.

#19 scarface-cD   Members   -  Reputation: 122

Like
Likes
Like

Posted 19 March 2002 - 04:21 PM

Anonymous Poster, any C++ compiler, including Visual C++, will accept C code. As C is the basis for C++.

#20 cyrax256   Members   -  Reputation: 149

Like
Likes
Like

Posted 19 April 2002 - 06:07 AM

quote:
Original post by Anakha
I hope you can help me out here. Is there any reason for me att all to continue learning from this book and those tutorials? None of them covers anything about Windows. Sure, I have to learn to crawl before I start to walk, but am I crawling the right direction??? I just don´t want to waste my time... Perhaps I am a little impatient, but hey: That´s just how i am :-)

And secondly, if there isn´t, what do you guys think that I should try with, so I can learn C language in the Windows environment instead of the boring DOS?



Well, the answer is simple: You need to crawl before walking. The ''Hello World'' program is the most direct and simple way to begin using the language. When you design a game, you have to be sure that most of the logic works before starting to work seriously on the Interface. Right now, I´m doing an Uno card game for Java, and for now it´s almost completely done in the console (or DOS), and I´ve been doing both parts: Nice graphics and logic, but if the game doesn´t work right without graphics, all your work will be worth crap.

Just my two cents...





PARTNERS