home
hardware prices
news
articles
forums
photos
user reviews
Tech Support Forums - TechIMO.com
>
PC Hardware and Tech
>
Webmastering and Programming
why wont this work
Join TechIMO for Free!
User Name
Remember Me?
Password
Register
Blogs
FAQ
Members List
Calendar
Search
Today's Posts
Mark Forums Read
Get bargains at
»
Thread Tools
Currently Active Users
: 1795
Discussions: 188,401, Posts: 2,243,599, Members: 232,629
December 5th, 2004, 07:27 PM
#
1
(
permalink
)
boogieman063
Member
Join Date: Nov 2004
Posts: 56
why wont this work
this is simple, its just supposed to print that stuff to the output fle.
call the function and print to the file.
the program runs but nothing is printed
#include <fstream.h>
int main()
{
void print();
ofstream fout;
fout.open("a:/out.txt");
void print();
fout.close();
return 0;
}
void print()
{
ofstream fout;
fout<<"spongebob\n";
fout<<"cs1318.004\n";
}
TechIMO.com Ads - Login or
register
for less ads.
Guest
,
Register Free!
to remove this ad and get your tech support questions answered in minutes!
December 5th, 2004, 07:35 PM
#
2
(
permalink
)
paul9
Ultimate Member
Join Date: Aug 2003
Location: Gateshead U.K.
Posts: 8,838
a:/out.txt
should that be
a:
\
out.txt ?
backslash instead of forward slash.
December 5th, 2004, 07:37 PM
#
3
(
permalink
)
paul9
Ultimate Member
Join Date: Aug 2003
Location: Gateshead U.K.
Posts: 8,838
also, if
spongebob\n
and
cs1318.004\n
include the \n as a command line switch, then you have probably reversed those slashes, too.
December 5th, 2004, 07:57 PM
#
4
(
permalink
)
boogieman063
Member
Join Date: Nov 2004
Posts: 56
the slashes are supposed to foward, im using dev c++ i dont know why its like that, but its either two backslashes or one foward slash.
«
Table Question
|
C++ Question - Array - Standard Devation
»
Currently Active Users Viewing This Thread: 1
(0 members and 1 guests)
Thread Tools
Show Printable Version
Email this Page
Posting Rules
You
may
post new threads
You
may
post replies
You
may not
post attachments
You
may not
edit your posts
vB code
is
On
Smilies
are
On
[IMG]
code is
On
HTML code is
Off
Trackbacks
are
Off
Pingbacks
are
On
Refbacks
are
Off
Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
halo 4 xbox help not working
squik-man
General Gaming Discussion
19
January 18th, 2004
07:02 PM
compaq presario 4540
mhoule
Technical Support
6
August 16th, 2003
05:52 AM
Burned cd not working on cd players
MrMcGriddle
General Tech Discussion
2
August 13th, 2003
06:17 PM
multi-dsiplay screwed up when switching to win 2k from win 98
thePh@r@oh
Graphics Cards and Displays
18
February 7th, 2003
11:54 PM
Confusion in hooking up wires to MB
mikey76
Motherboards
3
October 30th, 2002
11:43 AM
Most Active Discussions
Is It Just Me?
(
2906
)
Unarmed man on his stomach shot by ..
(
6
)
Misery Loves Company...
(
2144
)
New Build ( Finally )
(
6
)
CPU wont boot
(
7
)
Building a gaming computer advice
(
5
)
I think I just killed my computer w..
(
24
)
Folderchat Weekday thread
(
444
)
Upgrading RAM
(
6
)
Recent Discussions
What is the best external enclo..
(
0
)
Partition Magic 7.0 (Unallocate..
(
17
)
For cheap price and good qualit..
(
1
)
Left 4 Dead Small Freezes
(
3
)
RCA 52Inch HDTV wont turn on
(
4
)
wishin i could edit my aol prof..
(
0
)
Sporadic internet connectivity
(
2
)
Assassins Creed PC Problems
(
40
)
I think my PSU is dieing
(
1
)
Blackberry Storm, Gears of War ..
(
1
)
Core 2 Quad Q9550 system
(
3
)
COWBOOM Ripoff! Used Laptop w/$..
(
4
)
All times are GMT -4. The time now is
03:37 AM
.
TechIMO Copyright 2008
All Enthusiast, Inc.
Contact Us
-
Tech Support Forums - TechIMO.com
-
Archive
-
Privacy Statement
-
Terms of Use
-
Coupons and Deals and Dealighted
-
Store Ratings and Reviews
-
Web Business Blog
-
Top
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28