home hardware prices news articles forums photos user reviews
Go Back   Tech Support Forums - TechIMO.com > PC Hardware and Tech > Webmastering and Programming
Ask a Tech Support Question (free)!

why wont this work

Reply
Get bargains at  »  Dealighted.com
 
Thread Tools Search this Thread
Currently Active Users: 1521
Discussions: 200,952, Posts: 2,379,478, Members: 246,321
Old December 5th, 2004, 07:27 PM   Digg it!   #1 (permalink)
Member
 
Join Date: Nov 2004
Posts: 56
Angry
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";
}
boogieman063 is offline   Reply With Quote
Old December 5th, 2004, 07:35 PM     #2 (permalink)
It's the cheese guy! ¬_¬;
 
paul9's Avatar
 
Join Date: Aug 2003
Location: Gateshead U.K.
Posts: 9,167
Send a message via MSN to paul9 Send a message via Yahoo to paul9
a:/out.txt
should that be
a:\out.txt ?
backslash instead of forward slash.
paul9 is offline   Reply With Quote
Old December 5th, 2004, 07:37 PM     #3 (permalink)
It's the cheese guy! ¬_¬;
 
paul9's Avatar
 
Join Date: Aug 2003
Location: Gateshead U.K.
Posts: 9,167
Send a message via MSN to paul9 Send a message via Yahoo to paul9
also, if
spongebob\n
and
cs1318.004\n
include the \n as a command line switch, then you have probably reversed those slashes, too.
paul9 is offline   Reply With Quote
Old December 5th, 2004, 07:57 PM     #4 (permalink)
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.
boogieman063 is offline   Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search

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


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Most Active Discussions
Is It Just Me? (2943)
The disrespect of Obama by Russian .. (41)
Making Health Care Worse (178)
Wireless Televisions. (12)
CPU fan stops spinning randomly (9)
Regular Build (11)
windows 7 problem (7)
Is the PSU I received dead? (12)
radeon x850xt platinum & shader.. (6)
Print spooler problem (15)
HIS HD5770 graphic card question (15)
windows vista security holes (10)
Install XP pro and a Vista laptop ?.. (11)
Foreign voltage (10)
Recent Discussions
tv not turn on-makes clicking sound (2)
SELLING FRESH,CVV,LOGINS,DUMPS,TRACKS.. (0)
CPU fan stops spinning randomly (9)
EVGA 9800 gtx help with finding a goo.. (11)
Regular Build (11)
Help with onclick and buttons (0)
Modern Warfare 2: Who Bought It? (63)
Virus advise (8)
My monitor won't turn on after instal.. (1)
Laptop with wireless problem. (3)
Internet Lost (3)
Dept. of HS: NSA 'Helped' Develop Vis.. (16)
windows vista security holes (10)
Point and Shoot Camera Suggestions. (4)
Multiple Restarts Required at Boot (2)
Ideal cheap graph card for PC-Gaming? (18)
radeon x850xt platinum & shader 3 (6)
Graphics Card Upgrade Question (4)
For Sale BFG GTX285 OC2 with 10 year .. (3)
How to convert MP3's (4)
Wireless Televisions. (12)
Hp Artist Edition + Matching Bag (0)
Asus P4G8X Mobo (6)
Xbox 360 GTA: SA disk error (1)
Is the PSU I received dead? (12)


All times are GMT -4. The time now is 04:55 AM.
TechIMO Copyright 2009 All Enthusiast, Inc.



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