Click to See Complete Forum and Search --> : Initial grabbing routine for Intro to Prog


FooL
April 12th, 2001, 04:04 PM
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 :D )

I think it has something to do with cin.get but that doesn't seem to be working. Any help is appreciated.

DualP3Guy
April 13th, 2001, 09:21 PM
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.

FooL
April 14th, 2001, 10:21 AM
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!