CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: Speedo

Page 1 of 35 1 2 3 4

Search: Search took 0.04 seconds.

  1. Replies
    6
    Views
    1,365

    Re: References and copying objects

    Thanks for the replies, great info. :)
  2. Replies
    6
    Views
    1,365

    [RESOLVED] References and copying objects

    I'm used to the C++ world where there's a fairly clear distinction between dealing with an object directly and dealing with a pointer or reference... so maybe I'm overthinking things somewhat, but I...
  3. Replies
    2
    Views
    7,968

    Re: Bind StringCollection to a ListBox

    Apparently members have to be set up as properties before you can bind to them. I feel dumb now.
  4. Replies
    2
    Views
    7,968

    Bind StringCollection to a ListBox

    Can anyone give me an example of how to set this up when the StringCollection is a class member? I've been able to get it to work with a StringCollection that's in project settings, but can quite...
  5. Replies
    3
    Views
    1,030

    Recommend me a C# book

    Preferably something aimed towards a more experienced programmer (have about 8 years now of C++ experience, and various other languages). I've tinkered with C# from time to time and it isn't that...
  6. Replies
    28
    Views
    2,906

    Re: A question regarding singleton

    What you have there isn't really a singleton... it's something more like a factory. Only one A exists within the createA() function (thanks to it being static), but you have more than one A in your...
  7. Replies
    19
    Views
    1,893

    Re: Counting characters help

    "Continue" causes the rest of the loop to be skipped. So when it's triggered, execution just goes back to the start of the loop, meaning you never advance to the next character in the string.

    For...
  8. Replies
    17
    Views
    13,091

    Re: dynamic array allocation

    You pass the size. Or you encapsulate the array in an object that holds the size for you, like std::vector or std::tr1::array.

    If you want to play with things like this, none of us can stop you,...
  9. Replies
    5
    Views
    873

    Re: Pointers to array

    I'd say it's because with just "arr", automatic type conversion has the array decay into a pointer to its first value, with the type int*. The declaration "int (* ptr)[3]" specifically needs a...
  10. Re: What is the difference between operator and function?

    Because people tend to prefer looking at "A = B + C;" instead of "A = Add(B, C);".

    Operator overloads are syntactic sugar - they make code look neater/prettier. That's all.

    Edit: It may not...
  11. Replies
    12
    Views
    5,336

    Re: Is char s[3] = "abc" legal?

    Sure it's possible. But why would you want to? The concept of c-style strings revolves around them being null-terminated. The only time I can think of when you might even think about doing it is...
  12. Replies
    12
    Views
    5,336

    Re: Is char s[3] = "abc" legal?

    "abc" is 4 characters. 'a', 'b', 'c', '\0'.
  13. Replies
    73
    Views
    34,595

    Re: programming jobs without degree

    A lot of people in this thread seem to be forgetting the current job climate. Can you be a very good programmer without a degree? Of course. Are you likely to get a programming job at the moment...
  14. Replies
    9
    Views
    1,042

    Re: Any difference in the binary?

    In performance? I don't really see how it would. Member ordering can affect the object's size though, depending on compiler settings and so on (probably no difference for a simple case like that...
  15. Replies
    7
    Views
    1,060

    Re: Struct vs Class, take II

    Should only be a problem if you use a ctor/dtor, operator overloading, virtual functions, etc. All of which can be used with either struct or class.
  16. Thread: c++ structs

    by Speedo
    Replies
    3
    Views
    2,281

    Re: c++ structs

    It looks like the errors stem from missing includes in phonebook.h. The compiler reads and processes each file from top to bottom, so you need to include the appropriate headers for std::string and...
  17. Thread: Standard Macros

    by Speedo
    Replies
    9
    Views
    1,144

    Re: Standard Macros

    I'd really just save yourself the trouble and instead have the user define macros indicating that those features should be used.
  18. Replies
    3
    Views
    923

    Re: Knowing which standards are being used?

    I'm pretty sure C89 supports const. The Comeau online compiler in strict C89/90 mode doesn't complain about it.

    As far as version, there's the macro __STDC_VERSION__, defined as 199901L for C99. ...
  19. Re: How to check that CIN recieves correct data types?

    Check the stream for failure. See

    http://www.parashift.com/c++-faq-lite/input-output.html#faq-15.2
  20. Replies
    7
    Views
    1,366

    Re: Freeing memory from vector of structs

    You don't. The vector allocated the memory and the vector is responsible for cleanup. If you need to remove individual items you can do so using pop_back(). Otherwise you don't need to worry about...
  21. Replies
    7
    Views
    1,366

    Re: Freeing memory from vector of structs

    You only need to delete what you create with new.
  22. Replies
    3
    Views
    580

    Re: vstudio, debug, release and assembler

    Sometimes. You often do with games, for example, because performance can be unusably bad on the debug builds.
  23. Replies
    35
    Views
    3,207

    Re: why is it skipping lines?

    I didn't read the code in detail, but yes that looks more like what we're talking about.

    One thing though, on switch statements you can stack multiple options like so:


    switch(choice)
    {...
  24. Re: An "intermediary" class that gets a pointer from one object and sends it to anoth

    *cResult.getTotalSum() will attempt to dereference the value returned by getTotalSum rather than the pointer cResult. Use (*cResult).getTotalSum() or, preferably, cResult->getTotalSum().
  25. Replies
    8
    Views
    1,320

    Re: A question regarding operator new

    2 things:

    I believe you need to #include <memory> in order to use placement new.
    Also, placement new should take a void*, not an A*.

    That said, I agree with Lindley.
Results 1 to 25 of 859
Page 1 of 35 1 2 3 4





Click Here to Expand Forum to Full Width

Featured