Thread: Is there a user input command without using iostream.h?

  1. #1
    Unregistered
    Guest

    Is there a user input command without using iostream.h?

    Hi, I got DJGPP, and it doesn't agree with iostream. I doesn't come with iostream, so I took dev-cpp's iostream, tried it, and it said PROCCESS ERROR.

    I don't want to fix DJGPP or IOSTREAM. I just want to know if there is another command that will take user input, and change it into a variable. THX.

  2. #2
    Disagreeably Disagreeable
    Join Date
    Aug 2001
    Posts
    711
    Uh, do you know C/C++ at all?

    Here's some to try:


    Code:
    cin.get(myvar, 20); //Puts first 20 chars user enters (or once newline is detected, which ever comes first) into myvar.
    cin >> myvar; // Put all characters into myvar until newline or space is encountered.

  3. #3
    Registered User Engineer's Avatar
    Join Date
    Oct 2001
    Posts
    125
    Uh, do you know C/C++ at all?

    How about trying the regular stdio.h for I/O.

    cheers
    1 rule of the Samurai Code: if you have nothing to say, don't say anything at all!

  4. #4
    A Banana Yoshi's Avatar
    Join Date
    Oct 2001
    Posts
    859
    Don't use scanf(), it will screw up the program. <IT IS DANGEROUS> sine it steps into the ROM often.
    Yoshi

  5. #5
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    > Hi, I got DJGPP, and it doesn't agree with iostream.
    Perhaps if you posted this code, we could tell where the problem was.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Checking array for string
    By Ayreon in forum C Programming
    Replies: 87
    Last Post: 03-09-2009, 03:25 PM
  2. Structure and Linked List User Input Question
    By kevndale79 in forum C Programming
    Replies: 16
    Last Post: 10-05-2006, 11:09 AM
  3. SSH Hacker Activity!! AAHHH!!
    By Kleid-0 in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 03-06-2005, 03:53 PM
  4. Nested Structures - User Input
    By shazg2000 in forum C Programming
    Replies: 2
    Last Post: 01-09-2005, 10:53 AM
  5. ~ User Input script help~
    By indy in forum C Programming
    Replies: 4
    Last Post: 12-02-2003, 06:01 AM