Search:

Type: Posts; User: mickey0

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    39
    Views
    3,999

    inheritance and operator

    Hello,
    I've got this problem; probabily about inheritance:



    class Fruit { }
    class DriedFruit : public Fruit { }
    class Walnut : public DriedFruit {
    float _kCalories;
    public:
  2. Replies
    4
    Views
    1,191

    I should curious to implement it by myself...

    I should curious to implement it by myself...
  3. Replies
    4
    Views
    1,191

    getchar() and variant

    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...
  4. Replies
    8
    Views
    3,345

    Moreover, I don't know the "line" and "column"...

    Moreover, I don't know the "line" and "column" values at begin.....
  5. Replies
    8
    Views
    3,345

    hi, the question isn't it; I'm looking a...

    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........
  6. Replies
    8
    Views
    3,345

    iterator on a matrix

    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....
  7. Replies
    18
    Views
    2,094

    what I worndered is "what" I can/must declare...

    what I worndered is "what" I can/must declare with "forward declaration" (eg. vector seems not)
  8. Replies
    18
    Views
    2,094

    hi, then could you make me some examples when...

    hi,

    then could you make me some examples when it's suggested to use forward declaration (to improve speed compilation)?
    thanks
  9. Replies
    18
    Views
    2,094

    It doens't work; try this other minimal...

    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...
  10. Replies
    18
    Views
    2,094

    I now it by only now, but however is there any...

    I now it by only now, but however is there any chance to do it ? (it just only for completeness)
  11. Replies
    18
    Views
    2,094

    templating with inheritance

    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...
  12. Replies
    3
    Views
    1,284

    Probabily you can do something like this: ...

    Probabily you can do something like this:


    Class A {
    const int _p;
    public:
    A() : _p(10) { }
    //or
    A(int size) : _p(size) {}
    };
  13. Replies
    19
    Views
    4,842

    what I like is complete the exercise with the...

    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.
  14. Replies
    19
    Views
    4,842

    Finally, what do I have to do if I wanted to use...

    Finally, what do I have to do if I wanted to use ifstream::read ???
    It's still not clear to me....
  15. Replies
    19
    Views
    4,842

    At the moment my file is 14 lines and not 13; But...

    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...
  16. Replies
    19
    Views
    4,842

    I don't understand how to solve using char*;...

    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...
  17. Replies
    19
    Views
    4,842

    reading a file into a block

    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 );...
  18. Thread: c++ to C#

    by mickey0
    Replies
    1
    Views
    1,182

    c++ to C#

    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...
  19. Replies
    2
    Views
    1,173

    simple question on passing parameters

    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)...
  20. Replies
    5
    Views
    1,918

    sorry the code is again incomplete...I can have n...

    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...
  21. Replies
    5
    Views
    1,918

    hi, I don't understand what your last question...

    hi, I don't understand what your last question mean. could you post your code? thanks
  22. Replies
    5
    Views
    1,918

    vector problem

    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
    ...
  23. Replies
    6
    Views
    1,644

    how can I delete a file in c++?

    how can I delete a file in c++?
  24. Replies
    6
    Views
    1,644

    sorry, but my question want says without copy the...

    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?
  25. Replies
    6
    Views
    1,644

    write a file text

    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...
Results 1 to 25 of 32
Page 1 of 2 1 2