Search:

Type: Posts; User: killme

Page 1 of 3 1 2 3

Search: Search took 0.01 seconds.

  1. sorry, I recognize my example lacked on...

    sorry, I recognize my example lacked on specifics. here is an adaptation of your code to what I am looking for:


    #include <iostream>

    class base
    {
    friend std::ostream &...
  2. ok, so I worked arround the problem like this: ...

    ok, so I worked arround the problem like this:


    class base{
    friend std::istream & operator>>(std::istream & in, base & v);
    public:
    virtual void readtest();
    base();
    };
  3. overloading stream operators on derived classes

    S I want to have different >> operators for several derived classes. Has I tested...


    class base{
    friend std::istream & operator>>(std::istream & in, base & v);
    public:
    base();
    };
    ...
  4. Replies
    4
    Views
    2,265

    Ok, thank you both. I had not realised I could...

    Ok, thank you both. I had not realised I could pointers to the base function on the derived ones when I was reading about it. Here is my test code (feel free to suggest different approaches):

    ...
  5. Replies
    4
    Views
    2,265

    class polymorphysm and inheritance

    hi, I'm developing a numerical tool and wanted to figure out a way to restructure some of my code. So here is what I want to do:

    I want to create several (sub-)classes (model_1,model_2,...) that...
  6. Thread: maps to structs

    by killme
    Replies
    10
    Views
    1,599

    yes, I understand. but for now I'm chosing to...

    yes, I understand. but for now I'm chosing to avoid the problem rather than figure out exactly what it is (any bets on how thats gonna come back to bite me in the ass a couple of weeks from now?).
  7. Thread: maps to structs

    by killme
    Replies
    10
    Views
    1,599

    for some reason my simpler example works fine. ...

    for some reason my simpler example works fine.

    but I managed to work arround the problem without having the map static so I wont bother people anymore with this.

    thanks for the help
  8. Thread: maps to structs

    by killme
    Replies
    10
    Views
    1,599

    ok, so I finished building most member functions...

    ok, so I finished building most member functions of my class and when It came arrond to testing I ended up with a memory leak.

    a bit of messing about and I found out the program runs as intended...
  9. Thread: maps to structs

    by killme
    Replies
    10
    Views
    1,599

    yey, it works. thanks for the help. just to...

    yey, it works. thanks for the help.

    just to make sure I'm clear about order of operations (I'm probably not), this line...

    pp[1]=particle_properties(.32,1);
    ...translates into:

    1- create an...
  10. Thread: maps to structs

    by killme
    Replies
    10
    Views
    1,599

    oh, I've done that. or rather I've done correctly...

    oh, I've done that. or rather I've done correctly for pp and then when it didn't work and I created the "testmap" I forgot it (adding non-relevant 1 error line to the flaglist that I obviously chose...
  11. Thread: maps to structs

    by killme
    Replies
    10
    Views
    1,599

    maps to structs

    hey,
    I'm not sure what I'm doing wrong here and why is my code not compiling. I'm also not sure if there is a better aproach then mine and I'm always open to sugestions.

    so I'm trying to create a...
  12. Replies
    12
    Views
    5,352

    thanks every1, up until now I've been trying to...

    thanks every1,
    up until now I've been trying to keep the project I'm working on C++98 compatible but, seeing that C++11 is by far the best option here, I might opt for it.
    Now I just have to...
  13. Replies
    12
    Views
    5,352

    proper way to define a variable type

    I just compiled some code I've been working on at a different OS/compiler and realised that

    sizeof(unsigned long)
    returns 4 in one pc and 8 in another.

    I've heard that bytesize conventions for...
  14. Replies
    8
    Views
    2,502

    static functions

    Someone said to me once that when possible I should use static functions because it helps the compiler "in-line operations" (which I admittedly have no idea of the meaning). I was looking for...
  15. Replies
    6
    Views
    2,315

    what Salem mean is that on line 43 you have ...

    what Salem mean is that on line 43 you have

    myClass(thename);
    myClass is not an object. If you want to use a class constructor, you should actually "construct something".

    having that said,...
  16. Replies
    7
    Views
    1,948

    I'm still pretty unexperienced with object...

    I'm still pretty unexperienced with object oriented programing but I'm taking a look at inheritance in C++ Primer and I'll see what I can do. Thanks for the help
  17. Replies
    7
    Views
    1,948

    thaks for the help I actually need the...

    thaks for the help

    I actually need the function to change operations after the object is declared...i.e.:
    the object is declared... the function does one thing every time its called until the...
  18. Replies
    7
    Views
    1,948

    pointers to functions

    hey,

    I´ve been trying to use pointers to functions to alter the effect of a class function and I've apparently been using the syntax incorrectly. I've tried a few different ways and check one ref...
  19. Replies
    5
    Views
    1,717

    using C++11 isn't really an option (not that I...

    using C++11 isn't really an option (not that I don't have a compiler for it, its just a project requirement)



    this doesn't have the need to allocate temporary memory every time its called?
  20. Replies
    5
    Views
    1,717

    costructing a, object while pushing_back

    hey

    do I have a way to push_back a data sctructure into a vector without an outside copy? I mean: can I initialize the constructor of a class directly on vector im storing it?

    avoiding doing...
  21. well, right now you are initializing your storage...

    well, right now you are initializing your storage like this:

    char storeCharacters[] = {0};
    what size do you expect that array to be?
  22. Replies
    14
    Views
    2,540

    program is intended for linux, it requires a...

    program is intended for linux, it requires a library (LHAPDF) that currently has no way of being installed on PC (well, at least not an easy one) and the idea is for the source code to be released so...
  23. Replies
    14
    Views
    2,540

    this sounds silly but my only consideration...

    this sounds silly but my only consideration should be class data right?

    I mean, my class will have roughly 10 simple variables and a couple of arrays inside. the amount of member functions I put...
  24. Replies
    14
    Views
    2,540

    one of my project requeriments is to stay out of...

    one of my project requeriments is to stay out of C++11 for portability considerations (not really my choice). So reserve(), I'll look it up. thank you all
  25. Replies
    14
    Views
    2,540

    thats exacly the oposite of what thought. thanks,...

    thats exacly the oposite of what thought. thanks, I would pointlessly go the wrong way about this.



    I thought of that, the class will be used in more than one calculation, and in at least one...
Results 1 to 25 of 62
Page 1 of 3 1 2 3