A problem printing to terminal.

This is a discussion on A problem printing to terminal. within the C Programming forums, part of the General Programming Boards category; I am making it to input two numbers to a line and print the result to same line. example> input ...

  1. #1
    Registered User
    Join Date
    Feb 2008
    Posts
    2

    A problem printing to terminal.

    I am making it to input two numbers to a line and print the result to same line.

    example>

    input : 2 3 result : 5

    By the way, once I input two numbers and click enter key, my program goes to next line. I have to use enter key. Plz help me.

    ps : I am working in linux

  2. #2
    Registered User
    Join Date
    Oct 2001
    Posts
    2,129
    Please post your code.

  3. #3
    Registered User whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    7,738
    Well you are certainly not going to be able to do it with standard functions. Try using getch() from the <ncurses.h> library, and make sure that newlines and character returns aren't echoed to the screen. You can do that by examining what getch() returns.

  4. #4
    Registered User
    Join Date
    Feb 2008
    Posts
    2

    Smile Thank you.

    getch() solved this problem. Thanks again.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C# Printing Problem
    By silverlight001 in forum C# Programming
    Replies: 0
    Last Post: 03-23-2009, 01:13 AM
  2. Replies: 1
    Last Post: 06-07-2006, 09:42 AM
  3. Small problem with printing elements of an array
    By DLR in forum C Programming
    Replies: 17
    Last Post: 03-09-2006, 05:57 PM
  4. Problem with Printing message
    By robert_sun in forum C Programming
    Replies: 2
    Last Post: 05-16-2004, 02:09 PM
  5. problem with printing a structed array using for loop
    By Prezo in forum C++ Programming
    Replies: 2
    Last Post: 09-15-2002, 09:00 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21