Search:

Type: Posts; User: Mr.Pointer

Search: Search took 0.01 seconds.

  1. Replies
    15
    Views
    2,685

    I don't think s3abass will be able to answer,...

    I don't think s3abass will be able to answer, seeing that he hasn't been in these forums for so long :P. I'll also ask a question, hoping someone else knows the answer: How do I go about making...
  2. Replies
    11
    Views
    2,384

    So temporary objects are always const, which is...

    So temporary objects are always const, which is something I didn't know. Thanks :D
  3. Replies
    11
    Views
    2,384

    Whoops, I'm really sorry, I wrote a bad example!...

    Whoops, I'm really sorry, I wrote a bad example! What I meant to write was something like this:

    Number a = 20;
    a = 40;
    The constructor is indeed called twice, and your explanation makes a lot of...
  4. Replies
    11
    Views
    2,384

    Like I said, this happens when I remove the copy...

    Like I said, this happens when I remove the copy assignment operator, and when the class doesn't have an assignment operator for an int, it calls the constructor.
  5. Replies
    5
    Views
    1,101

    I used g++ for the above code and it compiled. ...

    I used g++ for the above code and it compiled.

    Why are you declaring an array with a variable size? Not all compilers can support it.

    EDIT: too late :P
  6. Replies
    11
    Views
    2,384

    Questions about constructors and operators

    I decided to start an extremely simple experiment to revise on things I already know, but came across two things that puzzled me. I have a class named Number, which only holds an integer named...
  7. Replies
    3
    Views
    947

    You have two syntax errors. One of them has to do...

    You have two syntax errors. One of them has to do with something you (probably) forgot to do, the other has to do with something you're not allowed to do.

    Even with those errors fixed, there's a...
  8. Replies
    6
    Views
    1,069

    it's funny, I had the exact same problem the...

    it's funny, I had the exact same problem the first time I tried to learn how to use classes! I suggest you follow the convention mentioned by anon, which is to use the upper-case character for type...
  9. Replies
    9
    Views
    11,909

    I once took a quiz that asked me to write a...

    I once took a quiz that asked me to write a case-insensitive version of strcmp. What I did was to simply compare every pair of characters (one from each string) after I had converted them to...
  10. Replies
    26
    Views
    17,717

    Almost everything I come across to reminds me of...

    Almost everything I come across to reminds me of something programming oriented. For example, someone on MSN yesterday called me mr T, and the first thing that came into my mind was "template <class...
  11. Thread: C/c++ ide

    by Mr.Pointer
    Replies
    12
    Views
    10,586

    I actually use a combination of both. For...

    I actually use a combination of both. For debugging, I compile at cygwin with a custom makefile and run gdb through the console. I find it more convenient this way. But, when it comes to everything...
  12. Thank you for your suggestion, I will keep that...

    Thank you for your suggestion, I will keep that in mind. I'm still practicing and learning along the way, so "functors" and C++0x lambdas are things I've not covered yet. But, I will get to them...
  13. Replies
    19
    Views
    1,983

    there's not a fixed size for int. It's usually 4,...

    there's not a fixed size for int. It's usually 4, but can be different in other systems. That's why sizeof() exists, it's a function that returns the size (in bytes) of a data type.
  14. Thank you very much, that did the trick! It makes...

    Thank you very much, that did the trick! It makes a lot of sense too, now that I think of it.

    I applied it the idea to my actual program as well, and it's working :D
  15. template woes: incompatibility & inheritance issues with a function as paremeter

    I managed to isolate a problem I'm having to this example program:

    #include <iostream>
    using namespace std;

    //Simple inheritance
    class Parent {};
    class Child: public Parent {};

    //Functions
  16. Thread: C/c++ ide

    by Mr.Pointer
    Replies
    12
    Views
    10,586

    Code::Blocks (http://www.codeblocks.org/) I...

    Code::Blocks

    I love it. It's free, portable, powerful, simple, and looks so pretty. Supports C and C++, and other languages as well.
  17. Replies
    2
    Views
    915

    Code::Blocks is an IDE that works with many...

    Code::Blocks is an IDE that works with many compilers, it's not a compiler... The mistake is that you did not specify the correct settings for the compiler you want to use (most likely the directory...
  18. I've no idea why, but putting: getline(cin,...

    I've no idea why, but putting:

    getline(cin, choice);
    instead of

    cin >> choice;
    seems to work.

    Perhaps a more experienced programmer could enlighten us as to why. I have a feeling it's...
  19. Replies
    5
    Views
    1,818

    The first one is wrong with only a first glance....

    The first one is wrong with only a first glance. Evaluate it step by step. What is the mistake?

    The second one is almost correct. Tip: You know that in C strings can be shorter than the array's...
  20. Replies
    9
    Views
    6,591

    There are many things wrong with your code. ...

    There are many things wrong with your code.

    temp=line next_Id(c[0] , 666666666);
    should be

    temp= next_Id(c[0] , 666666666);

    ...
  21. Replies
    10
    Views
    7,631

    I don't know what the warnings mean, but did you...

    I don't know what the warnings mean, but did you compile with the -g flag?


    gcc -g program.c

    This will put the debugging symbols and it might work for you despite the warnings (I personally...
  22. Replies
    5
    Views
    1,094

    Thank you for your replies! For the sake of my...

    Thank you for your replies! For the sake of my assignment, I'll use the method you suggested, which is having a default comparing function but also the possibility to accept other comparing...
  23. Replies
    6
    Views
    4,015

    Yeah, like I said, he should use the functions...

    Yeah, like I said, he should use the functions suggested to him. I just thought it would be very important to understand just why it produced a syntax error.


    Not that it changes anything in the...
  24. Replies
    6
    Views
    4,015

    temp[0] = '\0'; This will produce no syntax...

    temp[0] = '\0';

    This will produce no syntax errors.

    Anything contained within "quotes" can be considered as a char* pointer, even if there's a single character in it. So, by putting temp[0] =...
  25. Replies
    5
    Views
    1,094

    Flexible sorting

    Hello all,

    I'm new to C++ but I do understand the basics of programming. I've recently started getting serious and intend to go "pro" with it.

    I made a template LinkedList that can accept any...
Results 1 to 25 of 25