Author Topic: Turbo C  (Read 968 times)

Agent007

  • Member
  • **
  • Posts: 120
  • Kudos: 0
Turbo C
« on: 16 January 2003, 21:26 »
Hi

I use Turbo C in Windows to compile some simple C programs....When there is an error, they show up in the window below the code. Is there something similar for Linux?

thanks,


007
AMD Athlon processor
256MB SDRAM
Linux Distro - RedHat 9.0

shuiend

  • Member
  • **
  • Posts: 250
  • Kudos: 0
    • http://stuff4fools.topcities.com
Turbo C
« Reply #1 on: 17 January 2003, 00:49 »
i personly use Kedit for editing the cpp files and using g++ to compile them. you can uise g++ like this
g++ -o whatyouwantprogramtobecalled filename.cpp
This is probally not the best way to do it but it works for my needs. I just have kedit open and edit away then i save then compile. It tells me what errors i get then i go into kedit and edit where it says there errors are then resave and try again
you know its a bad day when you look more sober then usual

Agent007

  • Member
  • **
  • Posts: 120
  • Kudos: 0
Turbo C
« Reply #2 on: 17 January 2003, 21:23 »
Hi,

I have compiled the following c program, but when it is executed via the terminal, the printf statement dosen't show up...what cud be wrong?

thanks,
007

 
quote:

#include <stdio.h>
main ()
{
printf("Hello");
}

AMD Athlon processor
256MB SDRAM
Linux Distro - RedHat 9.0

voidmain

  • VIP
  • Member
  • ***
  • Posts: 5,605
  • Kudos: 184
    • http://voidmain.is-a-geek.net/
Turbo C
« Reply #3 on: 18 January 2003, 01:17 »
Try:

printf("Hello\n");
Someone please remove this account. Thanks...

Siplus

  • Member
  • **
  • Posts: 522
  • Kudos: 43
    • http://www.siplus.org
Turbo C
« Reply #4 on: 18 January 2003, 01:27 »
basic c/c++ question:
why does c++ have 2 print commands?
printf from stdio, and cout from iostream?


http://www.siplus.org

"Your computer is already fucked up by having Windows
on it, you can only unfuck it up by installing Linux."
-- void main (old school MES member)


Desktop: Athlon 2600/ 768mb DDR266
--Running: Ubuntu 5.10, FC4, Win2k
 (Also, Unbuntu 6-06:5, 5.04; Fedora Core 5, WinXP, but none of these are used much)
12" Powerbook: 1.5 Ghz G4 PowerPC / 1.25 GB DDR333
--Running: Mac OS X 10.4 Tiger

flap

  • Member
  • **
  • Posts: 1,268
  • Kudos: 137
Turbo C
« Reply #5 on: 18 January 2003, 01:46 »
Well basically because C++ features cout as part of its ostream class, but the stdio library is still available as well.
"While envisaging the destruction of imperialism, it is necessary to identify its head, which is none other than the United States of America." - Ernesto Che Guevara

http://counterpunch.org
http://globalresearch.ca


jtpenrod

  • VIP
  • Member
  • ***
  • Posts: 675
  • Kudos: 105
Turbo C
« Reply #6 on: 18 January 2003, 01:55 »
quote:
basic c/c++ question:
why does c++ have 2 print commands?
printf from stdio, and cout from iostream?
The reason for that is really quite simple: C++ is basically a superset of C, and as such, includes everything available in C itself. C++ commands such as: cout and cin are C++ objects that encapsulate the same operations that printf does.
_____________________________________
Live Free or Die: Linux

Their fundamental design flaws are completely concealed by their superficial design flaws.
Live Free or Die: Linux
If software can be free, why can't dolphins?

jtpenrod

  • VIP
  • Member
  • ***
  • Posts: 675
  • Kudos: 105
Turbo C
« Reply #7 on: 18 January 2003, 02:05 »
Code: [Select]
First off, the syntax is incorrect. Try this instead:
Code: [Select]
Secondly, there's a problem with running a console app in Winderz that you don't have with Linux. You need to cause the program to pause and busy-wait before it exits. That's why you add "getchar" so the program will wait for a character from the keyboard. Otherwise, the program outputs the "Hello" and exits so fast you'll never see it.

Just another wonderful Winderz "feature"        
____________________________________
Live Free or Die: Linux

Their fundamental design flaws are completely concealed by their superficial design flaws.

[ January 17, 2003: Message edited by: jtpenrod ]

Live Free or Die: Linux
If software can be free, why can't dolphins?

voidmain

  • VIP
  • Member
  • ***
  • Posts: 5,605
  • Kudos: 184
    • http://voidmain.is-a-geek.net/
Turbo C
« Reply #8 on: 18 January 2003, 02:23 »
My experience on the old days was all you had to do was add a "\n" to actually make it flush the IO with a CR. Will this not work today?
Someone please remove this account. Thanks...

flap

  • Member
  • **
  • Posts: 1,268
  • Kudos: 137
Turbo C
« Reply #9 on: 18 January 2003, 02:34 »
It should work without that.
"While envisaging the destruction of imperialism, it is necessary to identify its head, which is none other than the United States of America." - Ernesto Che Guevara

http://counterpunch.org
http://globalresearch.ca