LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-02-2005, 11:09 PM   #1
balu14u
LQ Newbie
 
Registered: Apr 2005
Posts: 2

Rep: Reputation: 0
printing on the console


hi

i want to know whether it is possible to print on the console without using printf() function. if yes how can i do that??

thanxs
balu.m
 
Old 04-02-2005, 11:30 PM   #2
speel
Member
 
Registered: Apr 2004
Posts: 354

Rep: Reputation: 30
i think its like echo whatever
 
Old 04-02-2005, 11:34 PM   #3
balu14u
LQ Newbie
 
Registered: Apr 2005
Posts: 2

Original Poster
Rep: Reputation: 0
hi speel,

thanxs for replying. but i don't understand. how do i echo that??

thanx
balu.m
 
Old 04-03-2005, 12:43 AM   #4
sudya
LQ Newbie
 
Registered: Mar 2005
Location: CA
Distribution: SuSE, Debian
Posts: 27

Rep: Reputation: 15
You can also use write, since the first parametr is a file descriptor, you just have to substitute it with console descriptor which is always 0, you can write something like that
Code:
#include <unistd.h>
char msg[] = "Hello Linux World!!!";
int  main(void)
{
    write(0, msg, sizeof(msg));
    return 0;
}
 
Old 04-03-2005, 08:09 AM   #5
speel
Member
 
Registered: Apr 2004
Posts: 354

Rep: Reputation: 30
Quote:
Originally posted by balu14u
hi speel,

thanxs for replying. but i don't understand. how do i echo that??

thanx
balu.m
just open up a console and type echo whatever
 
Old 04-06-2005, 05:35 AM   #6
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: Mint, Armbian, NetBSD, Puppy, Raspbian
Posts: 3,515

Rep: Reputation: 239Reputation: 239Reputation: 239
puts();
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Printing from the console? mentallo Linux - Software 2 12-02-2005 02:40 PM
Printing image from console theonebeyond Linux - Software 2 10-27-2004 04:36 AM
How to Run Win32 Console App in linux Console Lokie Linux - Software 2 08-12-2004 10:00 PM
Stop error messages from wireless card from printing on console robertgparker Linux - Newbie 3 07-27-2004 09:29 AM
Scribus Printing How to put 4 flyers on a page when printing jazzboy Linux - Software 0 05-02-2004 06:13 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:18 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration