Initial grabbing routine for Intro to Prog
Results 1 to 3 of 3

Thread: Initial grabbing routine for Intro to Prog

  1. #1
    Registered User FooL's Avatar
    Join Date
    Nov 2000
    Location
    Uter
    Posts
    280

    Angry Initial grabbing routine for Intro to Prog

    I've got an assignment for CS151 and I need a little help. I don't need someone to write it for me, just the command. (or function call, whatever...I'm used to DOS.)

    The whole deal is we need to write a .cpp that will grab a persons name from an existing file then take that name is get it's initials and output the name and initials to a new file.

    I've got everything working except the grabbing initials routine. I've tried everything I can think of. (Some stuff that makes 100% absolute sense to me...but apparantly not my compiler )

    I think it has something to do with cin.get but that doesn't seem to be working. Any help is appreciated.
    if(post.eof()){SigBox.setText("Have A Day.");}

  2. #2
    Registered User
    Join Date
    Apr 2001
    Location
    Raleigh,NC
    Posts
    89

    Talking

    How about a cin.get(name,1) that way it only gets one character. Also you could truncate it down to one character. I would use the get statement.

  3. #3
    Registered User FooL's Avatar
    Join Date
    Nov 2000
    Location
    Uter
    Posts
    280

    Post

    I've been trying cin.get(name) Perhaps that's why it's not working. I didn't use the comma 1. I could ask you all kinds of questions again, but I'll learn more if I try it myself. Thanks for the input!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •