Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Simple Question

Reply
Thread Tools

Simple Question

 
 
Materialised
Guest
Posts: n/a
 
      10-14-2003
Ok, I need some info on how to print in colours to the xterm using c.

take a simple program

#include <stdio.h>
voice main(void)
{
printf("I want this in colour\n";
return 0;
}

How would I go about getting coloured output?

Thanks

 
Reply With Quote
 
 
 
 
Materialised
Guest
Posts: n/a
 
      10-14-2003
Materialised wrote:
> Ok, I need some info on how to print in colours to the xterm using c.
>
> take a simple program
>
> #include <stdio.h>
> voice main(void)
> {
> printf("I want this in colour\n";
> return 0;
> }
>
> How would I go about getting coloured output?
>
> Thanks
>


lol oppps teach me to write code drunk no matter how simple

*void main(void)

 
Reply With Quote
 
 
 
 
Christopher Benson-Manica
Guest
Posts: n/a
 
      10-14-2003
Materialised <(E-Mail Removed)> spoke thus:

> Ok, I need some info on how to print in colours to the xterm using c.


I'll spare all the regulars the hassle (you're welcome, lol) by stating that
Standard C has nothing to do with colors or xterm. You'll want to post this
question in a newsgroup dedicated to your platform (comp.unix.programmer comes
mind). This newsgroup is dedicated to ANSI C, and all other questions are
off-topic.

--
Christopher Benson-Manica | Upon the wheel thy fate doth turn,
ataru(at)cyberspace.org | upon the rack thy lesson learn.
 
Reply With Quote
 
Materialised
Guest
Posts: n/a
 
      10-14-2003
Christopher Benson-Manica wrote:
> Materialised <(E-Mail Removed)> spoke thus:
>
>
>>Ok, I need some info on how to print in colours to the xterm using c.

>
>
> I'll spare all the regulars the hassle (you're welcome, lol) by stating that
> Standard C has nothing to do with colors or xterm. You'll want to post this
> question in a newsgroup dedicated to your platform (comp.unix.programmer comes
> mind). This newsgroup is dedicated to ANSI C, and all other questions are
> off-topic.
>

Thanks sorry for the waste of bandwidth.

 
Reply With Quote
 
Christopher Benson-Manica
Guest
Posts: n/a
 
      10-14-2003
Materialised <(E-Mail Removed)> spoke thus:

> *void main(void)


void_main_corrections++; /* and you thought INT_MAX was big */

The only standard prototypes for main() are
int main( void );
int main( int argc, char** argv );

Whatever source you're using that says your prototype is correct is wrong.

--
Christopher Benson-Manica | Upon the wheel thy fate doth turn,
ataru(at)cyberspace.org | upon the rack thy lesson learn.
 
Reply With Quote
 
Mark Gordon
Guest
Posts: n/a
 
      10-14-2003
On Tue, 14 Oct 2003 20:59:05 +0100
Materialised <(E-Mail Removed)> wrote:

> Materialised wrote:
> > Ok, I need some info on how to print in colours to the xterm using
> > c.
> >
> > take a simple program
> >
> > #include <stdio.h>
> > voice main(void)


Wrong.

> > {
> > printf("I want this in colour\n";
> > return 0;
> > }
> >
> > How would I go about getting coloured output?


You can't in standard C. Try in Unix programming news group.

> lol oppps teach me to write code drunk no matter how simple
>
> *void main(void)


I would say that is more wrong, but you can't get more wrong than
completely wrong. main returns an int so it is
int main(void)
--
Mark Gordon
Paid to be a Geek & a Senior Software Developer
Although my email address says spamtrap, it is real and I read it.
 
Reply With Quote
 
CBFalconer
Guest
Posts: n/a
 
      10-15-2003
Materialised wrote:
>
> Ok, I need some info on how to print in colours to the xterm using c.
>
> take a simple program
>
> #include <stdio.h>
> voice main(void)
> {
> printf("I want this in colour\n";
> return 0;
> }
>
> How would I go about getting coloured output?


Take a sheet of tinted transparent plastic and place it over the
CRT screen. If you have several sheets of different colors you
can adjust the color to suit.

In other words standard C can't do this. It depends on your
hardware and OS etc.

--
Chuck F ((E-Mail Removed)) ((E-Mail Removed))
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net> USE worldnet address!

 
Reply With Quote
 
Dan Pop
Guest
Posts: n/a
 
      10-15-2003
In <(E-Mail Removed)> Mark Gordon <(E-Mail Removed)> writes:

>On Tue, 14 Oct 2003 20:59:05 +0100
>Materialised <(E-Mail Removed)> wrote:
>
>> > How would I go about getting coloured output?

>
>You can't in standard C. Try in Unix programming news group.


Bad redirection. The question belongs to comp.terminals, because Unix
is as colour blind as standard C.

Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email: http://www.velocityreviews.com/forums/(E-Mail Removed)
 
Reply With Quote
 
Fao, Sean
Guest
Posts: n/a
 
      10-15-2003
"Materialised" <(E-Mail Removed)> wrote in message
news:bmhkd2$n5sj1$(E-Mail Removed)-berlin.de...
> printf("I want this in colour\n";


You might want to also fix this line.


 
Reply With Quote
 
Sheldon Simms
Guest
Posts: n/a
 
      10-15-2003
On Wed, 15 Oct 2003 13:34:50 +0000, Dan Pop wrote:

> In <(E-Mail Removed)> Mark Gordon <(E-Mail Removed)> writes:
>
>>On Tue, 14 Oct 2003 20:59:05 +0100
>>Materialised <(E-Mail Removed)> wrote:
>>
>>> > How would I go about getting coloured output?

>>
>>You can't in standard C. Try in Unix programming news group.

>
> Bad redirection. The question belongs to comp.terminals, because Unix
> is as colour blind as standard C.


Programming directly to the terminal would be silly.

Since *ix provides libraries to do this a unix programming
news group is a very appropriate place to ask.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Plz, a simple answer to a simple question about IP addresses MeekiMoo Computer Support 0 07-28-2009 08:10 AM
Simple region code question... simple answer?? joseph.greer@gmail.com DVD Video 7 01-26-2007 09:07 PM
Simple Question - Simple Answer? Daniel Frey XML 4 01-12-2005 04:25 PM
Re: Simple Simple question!!! Kevin Spencer ASP .Net 0 06-25-2004 05:25 PM
Re: Simple Simple question!!! ashelley@inlandkwpp.com ASP .Net 0 06-25-2004 04:18 PM



Advertisments