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

Search:

Type: Posts; User: Etherous

Page 1 of 4 1 2 3 4

Search: Search took 0.03 seconds.

  1. Replies
    7
    Views
    786

    Re: Variable Arguments

    int f(int, ... );

    int f(int, ... ) {
    .
    .
    .
    }

    int g() {
    f(1,2,3);
  2. Replies
    8
    Views
    5,704

    Re: [RESOLVED] Problems Using New Types

    Okay. This makes more sense. I'd thought that the compiler was just ignoring the const. That's how the error messages were making it look. Thanks
  3. Replies
    8
    Views
    5,704

    Re: [RESOLVED] Problems Using New Types

    The whole problem here is that you can't do something like this:


    typedef T MyType;
    const MyType foo;

    The compiler will simply throw the 'const' out and simply use T. That's why I was having...
  4. Replies
    8
    Views
    5,704

    Re: Problems Using New Types

    I want something const, so I put const in front of it. Why else would it be there? I don't care if it overwrites the constness of the type used. When someone explicitly says something, it should...
  5. Replies
    8
    Views
    5,704

    Re: Problems Using New Types

    Thanks. That was very informative. And yes, it seems ridiculous. Who would design a language like that? If I write const, then just maybe I'd like it to be const
  6. Replies
    6
    Views
    1,019

    Re: placing int into char*

    I just typed this up on the fly, so there's probably some errors:


    int intPow(const int n, const int p) // Gets n to the power of p
    {
    int ret = n;
    for(int i = 1; i < p; i++)
    ret *= n;...
  7. Replies
    6
    Views
    1,126

    Re: Loop Imitations

    Of course, any of these loops can be done using just 'if' and 'goto'. We have all these different loop structures because it makes it a little bit easier on the programmer
  8. Replies
    8
    Views
    5,704

    [RESOLVED] Problems Using New Types

    When I use typedef to create a new type, the compiler gives me errors if I try to tag modifying keywords on. For example, if I do this:


    typedef char* cstring;
    void function (const cstring...
  9. Replies
    4
    Views
    4,030

    Re: Concept, Concept Map, and Axioms

    Anyone?
  10. Replies
    4
    Views
    4,030

    Re: Concept, Concept Map, and Axioms

    For example, if I were to define an axiom as follows:


    axiom Associativity(Op op, T x, T y, T z)
    {
    op(x, op(y, z)) == op(op(x, y), z);
    }

    Will the compiler actually confirm that this is...
  11. Replies
    4
    Views
    4,030

    Re: Concept, Concept Map, and Axioms

    Is this restricting in that this must be true for a type in order to be used in the template, or is it the developer's responsibility to make sure it's true in all cases?
  12. Replies
    4
    Views
    4,030

    Concept, Concept Map, and Axioms

    So, I'm going over the C++0x draft, and I get to concepts. I'm understanding it up to where it starts getting into concept maps.
    What is the purpose exactly of a concept map as opposed to a concept?...
  13. Replies
    5
    Views
    828

    Re: Code::Blocks question

    square.h:


    #ifndef SQUARE
    #define SQUARE
    #include "shape2d.h"
    class Square : public Shape2d
    {
    ...
    };
  14. Replies
    4
    Views
    1,832

    Re: Doesnt Display Characters

    I haven't used arrays in a while, but don't you need to use a literal or static constant for the array size in the declaration? Try doing this instead:


    int *acres;
    acres = new...
  15. Replies
    5
    Views
    828

    Re: Code::Blocks question

    Just have each source file include all the other source files it requires to function, then use #ifndef to make sure it's only included once
  16. Replies
    4
    Views
    642

    Re: help with compilation error

    If you make the method take const&, then it will take the temporary values
  17. Replies
    3
    Views
    786

    Re: Checking out Mono

    Okay, thanks guys. So I should basically just look out for the usual, obvious stuff.
  18. Replies
    3
    Views
    786

    [RESOLVED] Checking out Mono

    So, I'm thinking about checking out C# Mono, and possibly incorporate it into a project I'm working on. As far as using C# as a platform independent programing language, what should I know, what are...
  19. Replies
    5
    Views
    847

    Re: self containing classes?

    I'd actually recommend making your own container class that not only stores the bonded atoms, but signifies type and strength of the bond, etc., but otherwise just like this
  20. Replies
    6
    Views
    878

    Re: C++ File IO Question

    It appears so
  21. Replies
    6
    Views
    878

    Re: C++ File IO Question

    No, "filename.txt" in not a string; it is an array of char primitives. Above when you created a string and assigned it the filename, what is happening is behind the scenes, the string object is...
  22. Replies
    21
    Views
    1,304

    Re: Structure Question.

    Sorry. You must have posted yours before I'd posted mine saying the same thing
  23. Replies
    14
    Views
    2,208

    Re: Anyone here an XCode expert?

    Ah. Yes that explains a lot
  24. Replies
    21
    Views
    1,304

    Re: Structure Question.

    Might be more convenient in the long run to just do this:


    typedef struct Weapon
    {
    ...
    } Weapon;


    Edit: ahoodin was faster
  25. Replies
    6
    Views
    878

    Re: C++ File IO Question

    You need to convert your string object to a char array (cstring) by calling c_str() on your filename object.
Results 1 to 25 of 82
Page 1 of 4 1 2 3 4





Click Here to Expand Forum to Full Width

Featured