Board index » delphi » Console

Console

I have C++ Builder v.5 professional and I'm somewhat overwhelmed by the IDE.
I wrote a program using console wizard in the regular C format.  The program
generates random numbers pulling the seed off the clock chip.  What I want
to do now is truncate the numbers that it generates down to three digits.
How?  Also, when I run my program, it opens a Dos window and spits the
numbers out.  How do I go about having those numbers displayed in a text
editor like Word pad or something like that?

                                        Michael

 

Re:Console


Quote
Monica Heller wrote:

> I have C++ Builder v.5 professional

This newsgroup is for Borland C++, not C++ builder. Please have a look at
the newsgroup descriptions at http://www.borland.com/newsgroups

Re:Console


truncate numbers down to 3 digits:
number = number % 1000;
(or just write:  number%=1000)

to display your numbers in Wordpad you must write them to a text file
(using fopen, fprintf etc)
and then open wordpad using Winexec or CreateProcess or one of the spawn
functions

Monica Heller <clean...@earthlink.net> schreef in berichtnieuws
3b263db2_1@dnews...

Quote
> I have C++ Builder v.5 professional and I'm somewhat overwhelmed by the
IDE.
> I wrote a program using console wizard in the regular C format.  The
program
> generates random numbers pulling the seed off the clock chip.  What I want
> to do now is truncate the numbers that it generates down to three digits.
> How?  Also, when I run my program, it opens a Dos window and spits the
> numbers out.  How do I go about having those numbers displayed in a text
> editor like Word pad or something like that?

>                                         Michael

Other Threads