Ya, I was told about his during lecture. The purpose of this is to simulate secondary storage access : /
ofstream outfile;
outfile.open("Bout", ios::out);
Does this mean open "Bout" for...
Type: Posts; User: I BLcK I
Ya, I was told about his during lecture. The purpose of this is to simulate secondary storage access : /
ofstream outfile;
outfile.open("Bout", ios::out);
Does this mean open "Bout" for...
I'm having problems with the basics of binary file i/o. I really don't know too much about file i/o so far, so I'll try to describe my question as best I can.
What I'm trying to do is to create a...
Thnxs. I gotta engrave this into my head somehow.
EDIT: heh i just read about the mention of "vector" in my book. It does sounds like it will make things a lot easier, but i dont wanna keep on...
Every once in a while, I mean year, I need to create an Array of Pointers to Structs (at runtime - user defined size) and i can NEVER remember how to do it and my reference book example doesnt seem...
Thnx for the advil :D
here it is:
I'm getting this compiler error(below) for 3 lines(in bold) that are similar where im trying to assign a pointer to a pointer and I cant figure out why. Shouldn't a pointer thats in a struct be able...
Ya, I was kinda thinking of how it wasn't going to work, thnx. I didn't skip over those functions heh... I just started writing this :) I haven't wrote anything for a while :/ so i cant really...
I don't think I've learned how to access all of an array of structs (that have pointers) through a member function. So, I'm trying to output all of the array's struct pointer to data , but I cant...
I know im not doing something right but i cant figure out atm. Ive tried looking up the error at microsofts page and i cant really make much sense of it. I have a client program that has:
#include...
That should be enough to solve your problem. (assuming you learned what a stack is and how it works. The '@' problem should be fundamental if you know what a stack is.)
What I'm really writing is a basic test inventory program. i just tried to dynamically cast but its not right
Inventory.h:
#include "InventoryItem.h"
#include "String.h"
using namespace...
whoops
Shape *pBasicShape[100];
should be:
BasicShape *pBasicShape[100];
didnt think of a dynamic type cast i think thats what i will need to do. and I am using a polymorphic base class....
My question is that can you put objects from several different objects into an array of pointers from a base class?(i think the answer is yes b/c its an array of pointers) and how would you access...
putting using namespace std; in string .h made them the errors disappear. im sort of confused on this namespace std. could you please explain what the cause of the problem is?
my intention was...
When i include iostream in String.h, it still gives the same errors
friend ostream& operator << (ostream &os, String &s) //line 23 - this line
{
os << s.pch;
return os;
}
...
Its much more simplier and logically reasonable to use a do while loop, but i dont see why you would want to use a for loop. To answer your question, yes I can do it with a do, and for loop, but its...
use a do-while loop because you dont know how many iterations your going through, but with a for loop you do.
do{
if (a%2==0)
{answer = a/2;}
else
{
answer =...
ack srry bout the double post i thought i lost all i typed when i hit the post thread button and got some Invalid thread specified error and thought "ahhh shhhhhht" ><
id prefer this one to be...
This works fine when its in a project with just these files. I have 2 problems: 1 is with the overloaded << and >> operators being inline and the compiler complains about not having access to pch...
This seems to work with the overloaded "<<" and ">>" operators placed in the header file, but complains about not being able to access pch even though its a friend function and i have no idea why its...
ajksld;fiaweg;whg *Bark bark*, *Grrrrrrr*
I found my error on this line
ifstream infile("c:LAB1DATA.txt");
should have been:
Well i agreee with you that i should be using standard code, but thats the least of my worries right now. I've helped out a friend with java and his instructor was a dinosaur who refused to accept...
well the instructor made no mention of depricated headers but on the sample codes its listed as ".h" and this is a data structures class so i dont think he really cares so <_<
First off, I'd like to say this is a hw problem. I have gutted out other functions that are fine and left only the one im having a migraine on X_X. So, the problem is reading data in from a file...