Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-4041-

Naming a Text file in C++

Name: OP !ewz/7gcXdY 2008-05-13 23:46

I am working on a small project, and I need to be able to let the user name there txt file. I have tried many things, none have worked.

Also, I'm not exactly the best C++ programmer, so if you could, please explain your answers with a lot of detail.

But what I want is:

char filename;
cin>>filename;
ifstream inputFile;
inputFile.open(filename, ".txt", ios::in);

Obviously, the last line of code is wrong, but thats what I would like to work. I have tried:

strcat(filename, ".txt");
inputFile.open(filename, ios::in);

And it did not work either.

Name: Anonymous 2008-05-13 23:50

>>1
Obviously.

Name: Anonymous 2008-05-13 23:52

I am working on a small project, and I need to be able to let the user name there txt file.
the user name their* txt file. you fucking moron.
Obviously, the last line of code is wrong, but thats what I would like to work. I have tried:
The others are wrong too.
Try sprintf or string::append and c_str().
Fucking imbecile cockass mothershit.

Name: Anonymous 2008-05-13 23:59

string(filename) + ".txt"

Name: Anonymous 2008-05-14 0:03

>>3
Kill yourself, asshat, I didn't ask for an english lession, just some C++ help. If it really pisses you off that much, don't answer. And with that said, thank you for answering. And again, kill yourself.

>>4
Thank you.

>>2
>>3
12am, have to be up in 5 hours for finals, I think english is the least of my worries right now.

Name: Anonymous 2008-05-14 0:11

>>5
Obviously.

Name: Anonymous 2008-05-14 0:16

>>5
I think your finals are the least of our worries right now.

Name: Anonymous 2008-05-14 0:26

>>5
Go eat a dick you fucking cretin, god damn you and everything you ever loved.
I cannot believe this shit, you are willing to help a mentally ill faggot, you provide him with solutions to solve just one a-few of his problems, and in return, in exchange, the ungrateful fuck tells you to suicide.
I'm so fucking angry right now that slaughtering a hundrend babies seems like a viable option.
Kill yourself, asshat, I didn't ask for an english lession,
English* lesson*.
What you asked for is irrelevant.
If it really pisses you off that much, don't answer.
Well, if correcting your English pisses you off that much, don't post. Oh, wait. Fuck YOU.
Fucking piece of shit motherfuckerfuck.

Name: Anonymous 2008-05-14 0:43

You…DOUBLE SEPPLER.

Name: Anonymous 2008-05-14 0:45

>>8
lol Tourette's.

Name: OP !ewz/7gcXdY 2008-05-14 0:47

>>8

I love you.

Name: Anonymous 2008-05-14 1:17

C++ is the ugliest shit ever.

I don't think I'll ever even try to learn beyond Pure C.

Name: Anonymous 2008-05-14 3:48

This board needs a healthy dose of Darwinism to get these pieces of shit out of here.

We are not your remedial intro C tutors, dipshits.

Name: Anonymous 2008-05-14 5:15

>>12
The best thing about C++ is the STL, and strings.

Name: Anonymous 2008-05-14 5:17

>>1
You should take criticism of your English language skills gratefully. There's no pride in not being able to communicate well. It's probably part of the reason you're so inferior at programming.

Name: Anonymous 2008-05-14 5:50

>>12

Because you're a moron.

Name: Anonymous 2008-05-14 6:12

>>14
all the good things about C++ are also in C99.

Name: Anonymous 2008-05-14 6:14

>>17
No

Name: Anonymous 2008-05-14 8:23

>>8
This guy knows how to win on the Internet.

Name: Anonymous 2008-05-14 21:35

>>19
But he can't spell hundred.

Name: Anonymous 2008-05-14 21:38

>>20
But he can't type ``hundred.''

Name: Anonymous 2008-05-14 23:49

/PROG/ IS BEYOND SAVING. IT MUST BE CLEANSED WITH FIRE

Name: Anonymous 2008-05-15 9:24

java.io.File
renameTo

Name: Anonymous 2008-05-15 12:49

>>23
Javaers?  With no idea what's going on?

Name: Anonymous 2008-05-15 19:19

>>1 is a moron, and the problem with modern programmers. You all think you can just suck a cock and your magically shitty English skills will make you look retarded -- COMPUTERS CANNOT RECOGNISE YOUR MISTAKES AND EXTRAPOLATE FROM CONTEXT WHAT YOU MEAN.

THEY ARE DIGITAL.

DIGITAL

DIGITAL

DIGITAL

!ANALOGUE

Name: Anonymous 2008-05-15 19:20

>>25
YOU DON'T KNOW WHAT A COMPUTER IS AND YOU THINK IT WILL JUST SUCK YOUR COCK LIKE THAT

Name: Anonymous 2008-05-15 19:34

>>25
I don't think an analogue computer could recognise human mistakes either.

Name: HAX MY ANUS MEME FAN 2008-05-15 19:39

>>27
I'm sure you REALLY like analogue computers, huh wink wink

Name: lol !8mQB/2odm6 2008-05-15 19:43

How has /prog/ gone downhill so quickly?

Name: Anonymous 2008-05-15 19:44

Analogue computers produce WARMER output.

Name: Anonymous 2008-05-15 19:46

I am haxing some anii with my analogue computer.

Name: Anonymous 2008-05-15 19:52

>>29
*grabs dick*

Name: Anonymous 2008-05-15 19:54

>>32
hax my anus

Name: lol !8mQB/2odm6 2008-05-15 21:19

I am ashamed of you.

Name: GJSussman !xpQSO2ECEY 2008-05-15 21:59

>>29,34
gtfo

Name: !MhMRSATORI 2008-05-15 22:13

>>35
I'd rather tell that to the people that is trying to force the ``hacks'' meme.

Name: lol !8mQB/2odm6 2008-05-15 22:15

>>35
Lord, do not tempt me, lest I strike thee down.

Name: GJSussman !xpQSO2ECEY 2008-05-15 22:31

Strike me down and I shall become more powerful than you could ever imagine

Name: Anonymous 2008-05-15 22:32

(strike-down >>38)

Name: lol !8mQB/2odm6 2008-05-15 22:33

The Sussman and I have actually been in regular contact since my fateful email -- we have nicknames for each other. I call him ``Bunny''.

Name: lol!8mQB/20dm6 2008-05-15 22:47

Sometimes he lets me suck his dick. also, tripfaggotry.

Name: GJSussman !xpQSO2ECEY 2008-05-15 23:04

Disregard this thread, i suck sicps

Name: Anonymous 2008-05-15 23:33

format c: /y

Name: Anonymous 2008-05-15 23:33

format c: /y

Name: Anonymous 2008-05-16 17:01

>>40
What does he think about /prog/ except it's unscientific and ultimately destructive

Name: Anonymous 2010-12-21 22:07

Name: Sgt.Kabukiman邀݊ 2012-05-23 5:45

All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy

Don't change these.
Name: Email:
Entire Thread Thread List