Stop Microsoft
Operating Systems => Linux and UNIX => Topic started by: Agent007 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
-
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
-
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");
}
-
Try:
printf("Hello\n");
-
basic c/c++ question:
why does c++ have 2 print commands?
printf from stdio, and cout from iostream?
-
Well basically because C++ features cout as part of its ostream class, but the stdio library is still available as well.
-
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
(http://www.otakupc.com/etsig/dolphin.gif)
Their fundamental design flaws are completely concealed by their superficial design flaws.
-
First off, the syntax is incorrect. Try this instead:
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" (http://tongue.gif)
____________________________________
Live Free or Die: Linux
(http://www.otakupc.com/etsig/dolphin.gif)
Their fundamental design flaws are completely concealed by their superficial design flaws.
[ January 17, 2003: Message edited by: jtpenrod ]
-
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?
-
It should work without that.