![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
hi: for(;;) goto hi;
|
Portable alternative to system("cls");?
My current work (learning without a teacher/class means I have to pick a new topic and play with it till I get it) is a regular old console app with 900+ lines of source, not including the header file. I could probably split it up into different files, but that's not the issue here.
This thing has to clear the screen a lot, because a menu is shown after anything you do. So far, as far as I know, anything I've written prior to this will run on any platform you throw it at. But now, however, I can't find something to clear the screen that isn't related to windows, all I know right now are system("cls"); and a win32 API call (which is obviously way over my head). Side question: Can anyone recommend a command line compiler that produces smaller executables? Right now I'm using g++ that came with Dev-Cpp, and the output is usually about 400kb bigger than the MSVS counterpart.
__________________
How do you play Religious Roulette? Stand around in a circle and blaspheme till someone gets struck by lightning. |
|
|
|
|
|
#2 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
There is no portable way to clear the screen. Why? Because the type of screen you have varies from system to system. Some systems might not even have a screen. Some might have a teletype. C/C++ does not deal with those things. A particular system's implementation of C/C++ may provide proprietary extensions to deal with those things.
The nearest thing I can think of as a 'portable' way to clear the screen is to feed a lot of newlines. This will, of course, leave the prompt at the bottom. Works on a teletype, too, though .If you find MS better than Dev-Cpp (minGW), why don't you use it? The debugger is far better, too.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#3 |
|
hi: for(;;) goto hi;
|
Well, that's no fun.
About the last part: I don't really have a preference, I like using g++ since I don't have to open any kind of IDE to do it. I suppose I could download VC++ express and borrow cl.exe with honor, though.
__________________
How do you play Religious Roulette? Stand around in a circle and blaspheme till someone gets struck by lightning. |
|
|
|
|
|
#4 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
VC++ is perfectly suitable for command line operations.
You seem to be of the opinion that IDEs are not used by "real men". Welcome to the world of driving nails with a high-heeled shoe. IDEs are tools. People who refuse to use a hammer because high-heeled shoes are manly, are fools. Your "honor" is not honor, it's stupidity. I'll wager that I can run rings around you in a command-line environment. There were no alternatives when I learned this shit. With your attitude, I would fire you in a New York second, if someone had slipped up and hired you to begin with. Tough words. Hope you don't ever get a reasonably intelligent and technically competent boss.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#5 |
|
hi: for(;;) goto hi;
|
er..
1. "borrowing with honor" is a funny way some people say "stealing" (probably misused here since I did the same with g++, and didn't know you could go without installing VC++'s IDE in the first place) 2. The reason I'm avoiding using an IDE is cause right now I'm on a computer that's pretty clunky, I don't want to waste any more system resources than I have to. At my own computer, I tend to use IDEs because they make life easier Guess I'll spare no details in any future posts, I didn't think I came off as an asshole.
__________________
How do you play Religious Roulette? Stand around in a circle and blaspheme till someone gets struck by lightning. |
|
|
|
|
|
#6 |
|
Professional Programmer
Join Date: Jan 2007
Location: Cape Town
Posts: 291
Rep Power: 2
![]() |
Wow, people seem pretty hostile as of late!
![]() |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Alternative to Frames | kruptof | HTML / XHTML / CSS | 6 | Jun 11th, 2007 4:36 PM |
| memcpy alternative for arm-elf-gcc | kurt | C | 6 | Nov 29th, 2005 5:53 AM |
| Portable Firefox | OpenLoop | Other Programming Languages | 8 | Nov 23rd, 2005 12:36 AM |
| Portable Document Format | qash | Project Ideas | 3 | Sep 10th, 2005 6:34 PM |
| alternative compression algorithm | Tor | Other Programming Languages | 10 | Sep 1st, 2005 8:57 AM |