tags:

views:

114

answers:

2

I was wondering how to put a variable where the bold text is text is:


ofstream file;

file.open ("example.txt");

+16  A: 

just put a variable there :-P

if you use std::string then you need to get the const char* using .c_str() so your options are:

const char *file = "example.txt"
file.open(file);

or:

std::string file = "example.txt"
file.open(file.c_str());
Evan Teran
Ah I see what you are sayin, but should I make the variable bold?
Hamish Grubijan
@Hamish filename variables are supposed to be in italic Times New Roman 10pt. Bold filename variables may be supported as a compiler extension, but it's nonstandard.
Tyler McHenry
A: 

source code is plain text, there is no such thing as a "bold" variable.

DevinEllingson
Bold is used as a placeholder. Not as formatting.
mikek3332002
@mike: Please explain.
C Johnson
I was trying to say that I don't know what this statement:Ah I see what you are sayin, but should I make the variable bold?means.
DevinEllingson