Hello,
I've got this problem; probabily about inheritance:
class Fruit { }
class DriedFruit : public Fruit { }
class Walnut : public DriedFruit {
float _kCalories;
public:
Type: Posts; User: mickey0
Hello,
I've got this problem; probabily about inheritance:
class Fruit { }
class DriedFruit : public Fruit { }
class Walnut : public DriedFruit {
float _kCalories;
public:
I should curious to implement it by myself...
Hello,
I need code this below but I need something like a getchar() that doens't wait for the "return" from the user. How can I implement it? (it only wait for a key pressed)
int ch;
while...
Moreover, I don't know the "line" and "column" values at begin.....
hi,
the question isn't it; I'm looking a structure as "matrix" that permits me to call stl_algorithm on coulumn and on lines to perform some calcolus........
Hello,
I need a matrix int matrix[x][y]; as you seen I don't know x and y and I opted for a vector of vector; problem: times I need to perform some operation on one "Line" of the matrix" eg....
what I worndered is "what" I can/must declare with "forward declaration" (eg. vector seems not)
hi,
then could you make me some examples when it's suggested to use forward declaration (to improve speed compilation)?
thanks
It doens't work; try this other minimal example.......
--
For the question of template, I read
this
and It is more useful; I prefer add the line "template class Square<float>;" at the end...
I now it by only now, but however is there any chance to do it ? (it just only for completeness)
Hello,
I attach you this code; i should have 2 problems:
1. (most important) the use of template gets these errors; how come?
error LNK2019: unresolved external symbol "public: __thiscall...
Probabily you can do something like this:
Class A {
const int _p;
public:
A() : _p(10) { }
//or
A(int size) : _p(size) {}
};
what I like is complete the exercise with the read(); it's not clear to me if I have to use memset to clean the memory or/and put the '\0' (anche in wich position).
Thanks.
Finally, what do I have to do if I wanted to use ifstream::read ???
It's still not clear to me....
At the moment my file is 14 lines and not 13; But it's a simple test; it could be 10,000 lines too.
I didn't know that I can't use tellg with a text file; so if it is RIGHT, I have to find a...
I don't understand how to solve using char*; tellg() says me 181 chars, but gcount() (called after the read and not before) says me 168; I'm on windows; If I put _buffer[size+1]='\0' is it ok, but...
Hello,
I've done this:
long size;
ifstream file (name, ios::ate); //open and go at the end
size = file.tellg();
char* _buffer = new char [size];
//memset( _buffer, 0, size );...
hello,
I note that in C# I can do this:
class A {
private StringBuilder s = new StringBuilder();
}
I mean: in c++ the instance has to create in the costructor; C# permit to create in...
Hello folk,
I have to code one thing like here below but I'm confusing on use of ...
Ho can I do that for with ...?
void Tree::createTree (Node* params ...) {
for (int i=0; ??????? ; ++i)...
sorry the code is again incomplete...I can have n files (eg 20, 30) and I need to open they 2 at time (then I close two files and go on with other two). I think it's right. probabily I can't keep...
hi, I don't understand what your last question mean. could you post your code? thanks
hi, I can't understand how use it:
string temp_str;
vector <fstream*> file;
for (int i=0; i < 2; i++) {
fstream* ff = new fstream;
*ff << i.toString(); //pseudo-code
...
how can I delete a file in c++?
sorry, but my question want says without copy the file the data in a file; I just say: overwrite a file text line. Is it possible?
hi,
I have a file text:
hello
house
sunrise
down
I need change the first line to "goodnight". But how do I have to open file? in append mode it it goes at the end; out mode it'll...