Search:

Type: Posts; User: Wledge

Page 1 of 6 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    3
    Views
    1,492

    template Foo Foo2::foo2( void )...

    template <class T>
    Foo<T> Foo2<T>::foo2( void ) const
    {
    return Foo<T>();
    }
    ...
    int main( void ) {
    Foo2<int> foo2;//<-- no ()
    Foo<int> foo = foo2.foo2();
  2. Replies
    2
    Views
    891

    #include ... std::string str;...

    #include <string>
    ...
    std::string str;
    getline(file,str,'\n');
  3. Thread: std::auto_ptr

    by Wledge
    Replies
    6
    Views
    1,109

    Guru of the week,using auto_ptr...

    Guru of the week,using auto_ptr.
  4. Re: Having an ofstream in the private data of a class

    ...
    private:

    std:: ofstream _fileStream1;
    };
  5. Replies
    5
    Views
    1,143

    No, 7.1.2 Function Specifiers,Footnote 79 So...

    No,
    7.1.2 Function Specifiers,Footnote 79

    So they have the linkage they'd if inline was not specified. Linkage is always defined, the three choices are internal, external, or no linkage. An...
  6. Replies
    5
    Views
    3,859

    int result = (int)floatingPointInt % 10;

    int result = (int)floatingPointInt % 10;
  7. Replies
    13
    Views
    2,492

    http://www.boost.org/doc/html/any.html

    http://www.boost.org/doc/html/any.html
  8. Replies
    18
    Views
    31,345

    No,read...

    No,read http://www.eskimo.com/~scs/C-faq/q16.6.html
  9. Replies
    4
    Views
    3,840

    Re: base class pointer to derived class objects

    That is called object slicing,not good.

    That is correct


    BaseClass *ptrBaseClass=new BaseClass;
    ptrBaseClass = ptrFirstDerivedClass;
    ptrBaseClass = ptrSecondDerivedClass;
  10. Replies
    3
    Views
    1,256

    #include ... class Example {...

    #include <cstdlib>
    ...
    class Example
    {
    public:
    Example(){ cout << "Constructor called"; }
    void* operator new(size_t size)
    {
    return std::malloc(size);
    }
  11. Replies
    5
    Views
    3,424

    The 100% correct way is to include iterator....

    The 100% correct way is to include iterator.
    Dinkumware C++ Reference http://www.dinkumware.com/manuals/reader.aspx?b=p/&h=iterator.html (click on the logo).

    In your code you include...
  12. Replies
    5
    Views
    3,424

    Re: ostream_iterator(cout," ")

    Jepp,include <iterator>
  13. Replies
    8
    Views
    12,057

    #include int main() { int array[]...

    #include <stdio.h>

    int main()
    {
    int array[] = {-1,3,4,8,4,30,-3,0};

    int maxEl,minEl,i;
    maxEl = minEl = array[0];
    for(i = 1;i < 8;i++)
    {
  14. Replies
    1
    Views
    1,077

    operator+(throttle& temp, throttle& temp2); is...

    operator+(throttle& temp, throttle& temp2); is not a member function.


    class throttle {
    ...
    throttle(throttle&);//copy constructor
    friend throttle operator+(const throttle& temp,const ...
  15. Thread: Minimum Macro

    by Wledge
    Replies
    6
    Views
    2,343

    #define MINIMUM1(a, b) (((a) < (b)) ? (a) : (b))...

    #define MINIMUM1(a, b) (((a) < (b)) ? (a) : (b))
    ^^^^ no space here
  16. Replies
    2
    Views
    4,109

    Usually it's related to corruption in the .ncb...

    Usually it's related to corruption in the .ncb file. Close your project, delete the .ncb file, and reopen the project.
  17. Change the name swap -> my_swap for example....

    Change the name swap -> my_swap for example.
    swap is already a template function in std namespace.
  18. Replies
    35
    Views
    5,788

    No,not 100% correct. 6.3.2.2. The types char...

    No,not 100% correct.
    6.3.2.2.

    The types char ** and const char ** are both pointers to unqualified types that are not the same type, they are not compatible types. Therefore, a call with an...
  19. Correct....

    Correct.
    https://www.dinkumware.com/manuals/reader.aspx?b=p/&h=sstream.html

    ...and basic_strinbbuf



    Example
  20. Replies
    2
    Views
    1,393

    int len = SendMessage(lb, LB_GETTEXTLEN, index,...

    int len = SendMessage(lb, LB_GETTEXTLEN, index, 0);
    char* fNameBuf = new char[len];

    MSDN LB_GETTEXTLEN

    You need +1.
  21. Replies
    8
    Views
    1,081

    #include ... if(0 ==...

    #include <cstring>
    ...
    if(0 == std::strcmp(string,"you"))
    {
    cout << "me" << endl;
    }
  22. Replies
    5
    Views
    1,027

    Re: operator overloading - global, member or both

    Hmm,No.


    class Foo
    {
    int val;
    public:
    ostream& operator<<(ostream& os) {
    return os << val;
    }
  23. Replies
    3
    Views
    1,081

    Re: how can i determine the size?

    use std::vector


    #include <vector>
    ...
    std::vector<inventory_items> itemVec;
  24. Replies
    3
    Views
    1,137

    Re: operator = overloading

    In operator=?Nothing.yearofbirth is const,since the constructor call and till the destructor call.

    Instead you should take care of this
    > m_pCar= other.m_pCar;
    Uh,thats wrong,now two...
  25. Replies
    8
    Views
    2,056

    void I_eat_foo_too(FOO (*foo)[5]); ... FOO...

    void I_eat_foo_too(FOO (*foo)[5]);
    ...

    FOO foo[5];
    I_eat_foo_too(&foo);
Results 1 to 25 of 148
Page 1 of 6 1 2 3 4