is this a legal statement if I include fstream.h:
fopen(C:\Windows\EXITTO~1.PIF) /*this exits windows and opens in dos mode*/
If not, how would I do this. I am a beginner when it comes to opening and closing files.
Printable View
is this a legal statement if I include fstream.h:
fopen(C:\Windows\EXITTO~1.PIF) /*this exits windows and opens in dos mode*/
If not, how would I do this. I am a beginner when it comes to opening and closing files.
that would just open the file for io, if it was executable it would not execute within your program... also, you'd ahve to enclose that in quotes, as well as give fopen correct arguments for access rights etc...
actually
do this
(with fstream)
Code:fopen("c:\\wherever\\filename.txt");
// because of the \ command the processor will think u are typing
// a new line if it is \n or something else so \\ is the operator for '\'
// hope ya get it
oh yeah, the escape sequences... you could also substitute for a forward slash [i know *nix supports it, and your compiler just might... myne [djgpp] does...]
Am i the only one that cant load the "New Thread" page? What the hell is going on?
Anyways I have a problem that I hope someone will read on this page:
Ok, I am trying to import a class (from rect.h) into rect.cpp. I only have a little because I dont know what I am doing:
#include "rect.h"
#include <iostream.h>
Rectangle::Rectangle()
{
length = width = 0;
}
Rectangle::Rectangle(int l, int w)
{
length = l;
width = w;
}
//......
void Rectangle::SetLength(int l)
{
//....
}
here is the .h file, tell me if there are any probs with it, i dont think there are:
class Rectangle {
public:
//constructors
Rectangle();
Rectangle(int l, int w);
//member functions
void SetLength(int l);
void SetWidth(int w);
void GetArea();
void GetPerimeter();
void PrintRectangle();
private:
int length;
int width;
};
AND IF SOMEONE WOULD PLEASE POST THIS MESSAGE IN A NEW THREAD THAT WOULD BE GREAT, my browsers are refusing to load the new post page.
someone look ^^^here^^^ please