Is it possible to write Tower Defense in C/SDL [closed] - c

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I have to write Tower Defense game in ANSI C using SDL library, but the deeper I go into LazyFoo's tutorial, the more I got this feeling that's impossible to write it in pure C due to limitations. So my questions is - am I in big trouble or I'm just panicking. It has to be a simple tower defense game, nothing fancy, but is it possible to do it using only C?

C is a Turing-complete language so anything you can do in some other language can be done in C, too. And SDL provides you with a graphics API which is commonly used for (usually small/indie) games.
Of course it might be more pleasant to write it e.g. in C++ or a higher-level language such as C# or Python - but it's possible in C nonetheless.
TL;DR: Yes, it is totally possible.

Related

How to start building a programming language in C? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I really would love to go through the experience of building a compiler, lexer, and so on using C, however I havn't found a single resource on creating one. I've read the book about creating your own language using Ruby, but it just talks about how C is the best option, and won't tell you where to go from there.
Is their any nice resources for building a language using C? I don't care how long it is, I just want to know how to build one.
One of the nice things about compilers/interpreters is that it doesn't really matter what language they are written in. In the final stage they will just be an executable on someone's machine.
That being said while writing my compiler (something I am currently doing) I have used several books that have been extremely helpful:
Compiler Construction by Niklaus Wirth
Compilers Principles, Techniques, and Tools by Jeffrey Ullman, Alfred Aho, Ravi Sethi
The Wirth book will walk you through all the stages of creating a compiler for a language called Oberon-0. It also has the entire source code for his finished compiler, so you can play around with it on your own machine. The compiler itself was written in Pascal (something else that Wirth created).
The Dragon Book has really good information and examples in C! This may be what you are looking for, but as I said above, the language you write the compiler in isn't all that important.

A book for C beginners [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I am a PHP developer, and now I want to learn C for a couple of reasons.
I lack knowledge in Java, as well as data structures and algorithms.
PHP is written in C.
The most important thing is the first reason. I don't want to get deep into C, but at least I could understand what C programs are doing. Does anyone have any good idea how I should proceed? Thanks!
That's probably the wrong approach. First learn the basic theory behind programming which is algorithms and datastructures. These are language neutral.
Than try to learn a language and its syntax to write your algorithms. To answer your question, a good book for C is C in a Nutshell but it DOES NOT teach you the basics of programming.
And then there is still the book The C Programming Language by Kernighan&Ritchie, who invented C.

Is there a preferable programming language for CGI apps? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I know that I can write CGI in many languages, the most are C and Perl.
But why I have to write it in Perl or in C?
What's the difference and what's the (eventually) the best and safe solution?
The advantage of nearly all dynamic languages over C is that it's much harder to get buffer overflows while doing string manipulation, which can easily become a security problem.
Also Perl has libraries that help you dealing with the CGI protocol, and they are battle tested and stable.

In embedded application why c is most poppular? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
see ,
still yet i have seen that most of the embedded application are written in c.
Most of the libraries are written in c.
Device-driver are written in c.
So i want to ask you is there any logical reason behind this?
(My apologies if this post sounds silly/stupid. I thought I'd ask here. Ignoring these core bits never made anyone a better programmer.)
There are many reasons, including but not limited to:
It has access to many low level functions not accessible from many other languages.
It has existed for many many years and has lots of developers that are familiar with it.
If written well it's extremely efficient.
It gives almost complete control over memory etc.
It's very portable, largely due to the myriad of compilers written for it.
Because of Dennis Ritchie. C is easily the most portable language.

graphics in C for learning [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
I want to develop some graphical application in C using gcc compiler on Linux.
Which graphics library shall I use to start with? How can I start developing graphics appication on Linux using C?
If you are talking about straight graphics look at:
SDL
GGI (very simple)
If you are talking GUI, QT would certainly be your best bet.
SDL -- http://www.libsdl.org/
Very straightforward to use, and powerful.
If you want pure C (vs C++), there's SDL: SDL, a standard in C library.
If you like C++, there's also SFML: SFML

Resources