• Advertisement

Archived

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

Questions about C

This topic is 6553 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

okokok im learning C right now because i only have a book on The C programming language. I will be learning C++ sooner or later, but i have a question. Is there a way to make graphical games in C, and can you make windows programs in C. just a few simple questions. I have already made a simple trivia game but that about it. If you want to find out more about my trivia game go to www.geocities.com/comprev2001

Share this post


Link to post
Share on other sites
Advertisement
Yes you can make grephical games in C. I beleve that Quake and possibly Quake 2 were programmed in C. As for windows I''m not 100% sure but I''d be very surprised if you had to use C++ to make Win programs.

Share this post


Link to post
Share on other sites
hey man!

Yes you can make games with c. Infact Quake3 was made in C!! And yes you can make windows programs in C too!

later

node_5r

Share this post


Link to post
Share on other sites
cool thanx. But one thing is borland C++ 5.02 any good, and im making a trivia game like this
printf("?\na. ?\tb. ?\nc. ?\td. ?\n");
answer = getchar();
switch (answer){
case ''a'':
x = 1000;
printf("?!\n");
break;
case ''b'':
printf("? $%d.\n", x);
break;
case ''c'':
printf("?$%d.\n", x);
break;
case ''d'':
printf("?$%d.\n", x);
break;
default:
printf("?\n");
break;
}

ok and i have multiple strings set up like that, but i want to know how do i make it so that different files are selected all the time, like lets say i have 10 questions like this how do i make it so that it doesnt always display them in the same order, note the code should be in C, and are u sure quake was coded with C because C++ has been around since ?1978? so I think they might have used C++ but i think Doom or Wolfenstien 3D was coded in C. Does anybody here know anysties were to get info on C coding, im going up a ladder and i will learn C later. Plus im only 13 so im learning through books. thx

Share this post


Link to post
Share on other sites
I think Quake3 was coded in C because i have seen the source code, and it doesnt use iostream.h or any of the other C++ functions, and how would you be able to program window programs in C. Please, thx

Share this post


Link to post
Share on other sites
yes, Quake was coded in C. In fact, it was compiled using the freeware DJGPP compiler. I am not sure about Quake 2 or 3.

Share this post


Link to post
Share on other sites
Quake 2 and 3 for Win32 were done in Visual C++. 6.0, most likely. As for MacOS and Linux...MacOS is probably CodeWarrior and Linux...gcc.

Share this post


Link to post
Share on other sites
Erm....Quake 3 was definitely not done in C.
The source code you saw was for the user-programmable modules (probably the DLL version; but carmack made his own language also), and doesn''t use iostream.h etc. because it doesn''t need to and was kept simple.
Besides, many times carmack has posted some C++ code on QuakeFinger

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Quakes 1-3 were done completely in C, aside from some assembly used for the graphics engine I think.

Share this post


Link to post
Share on other sites
hmmm. Assembly language. That Sucks. One thing I dont get is that if they used an Assembler they would have to compile the game multiple times for different processors like the Athlons and Pentiums which have different architectures???. (sorry bout my spelling). Also why does C have to be so complicated??????????? And will you guys answer my question already. The Athlons are a new type of x86 or x87 ??i think??. BTW Quake3 rulez.

Share this post


Link to post
Share on other sites
Quake 1 - ANSI C, compiled using DJGPP, and lots of assembly
Quake 2 - ANSI C, compiled using Visual C++ 4.0, and lots more assembly
Quake 3 - ANSI C, compiled using Visual C++ 6.0, with not nearly as much assembly

Fun, no?

Oh, and Athlons and Pentiums support the same instruction set, the x86 instruction set. This means that a normal x86 compiler will generate code that can run on either. They both also support some extended instructions that are unique to them, that you pretty much have to manually code for in assembly language to use.

More fun, no?
Jonathan

Edited by - Jonathan on 3/11/00 5:50:25 PM

Share this post


Link to post
Share on other sites
Look,
Wolf3d, Doom, Doom2, Quake, Quake2
All coded in C & asm.
You can even download the source for
Wolf, Doom and Quake(1) and check it if you want.
Quake had it''s own scripting language (QuakeC)

Quake3 was coded in C/C++ it had generated
asm for different processors (hand optimized too,
but initially generated) Quake3 also has it''s
own language which is mainly for portability
between OS''s and processors, which is why there
is a VM and all the other crap that goes with the
territory.

Athlons? thats a processor developed by AMD, I''m
not sure which architecture they follow, I doubt it''s
intel''s, but I do know they have their own additional instructions and the name is just so they can patent it.

If any info there is wrong, I''m sure someone will
point it out.

Take it easy,

-Mezz

Share this post


Link to post
Share on other sites
From a lot of benchmarks and such that I''ve seen, Athlons outperform Pentium IIIs. And, yes, Athlons use x86 architecture, otherwise people wouldn''t be able to run Windows 9x on ''em. =)

I''m not aware of Mr. Carmack ever having used C++ for any of his games. In fact, I don''t even know of his having used C++ for anything he''s released at all--he seems to prefer Objective-C (I wish I were cool and knew Objective-C =) ). It''d be cool if he were to come on here and give us the story straight from the source, if only because we all seem to be in some slight disagreement. =)

Share this post


Link to post
Share on other sites
i''m pretty sure that at least Q3 used C++ for the engine (i remember reading somewhere about why id decided to switch to C++ for the engine, for either Q2 or Q3, because of modularity purposes i believe)

Share this post


Link to post
Share on other sites

  • Advertisement