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

Search:

Type: Posts; User: monarch_dodra

Page 1 of 80 1 2 3 4

Search: Search took 0.13 seconds.

  1. Replies
    14
    Views
    360

    Re: How to solve this factorial

    Hum... I took it for granted you could also use ifs. Just not control "structures", eg for, while, do-while...
  2. Replies
    14
    Views
    360

    Re: How to solve this factorial

    What do you mean, "not possible"?



    Agreed. I'm also wondering if there isn't a typo in there. If both n and m are 1, then you'll overflow your integers (4! => 24, 24! > 2^^64 ).

    Also, what...
  3. Re: how to convert vector to std:string ?

    It almost works yeah. There are 2 issues: append accepts a "const char*", but you are giving it an "unsigned char*", so you will have to cast that. Furthermore, the fact that you have an "unsigned...
  4. Re: how do I store and retrieve this data in my class?

    I didn't go into full details of your post, but it sounds like you are tyring to use some kind of dictionary-like data structure, that would map, say a threshold (50 for pw50), which would map to the...
  5. Re: how to convert vector to vector ?

    The big question here is not how you convert from one container type to another, but rather, how will you be converting the elements themselves, eg: vector<unsigned char> to unsigned char*.

    There...
  6. Replies
    27
    Views
    1,343

    Re: passing smart pointer

    Meh. Personally, I don't believe you could say either way based off of type alone, but rather "what" you consider the argument is. As you say, a pointer is itself both a value, and a reference to...
  7. Re: How to understand this simple piece of code?

    Are you kidding? I mean, seriously? The answer is in the reply you *just* quoted:



    How can you not understand this?
  8. Re: How to understand this simple piece of code?

    r is passed by value, so any changes to r itself will not be seen at the end of the call: Even if in "reverseStr", r points to the middle of the string, the one in main will be unchanged.
  9. Re: Creating a function in c please help gurus

    Homework? C or C++? What are your interface needs (std::string? in-place editing? malloc? static buffer?)?

    Also, please clarify what it is your function should do:
    i need to pass input as...
  10. Replies
    3
    Views
    307

    Re: Program to sort lists?

    This is a strange question, in regards that you already said "I want it to get rid of any line that contains a word that isn't in an English dictionary".

    Please clarify your needs. For example,...
  11. Re: Help in operator > overloading in Library

    You are supoosed to *declare* your functions with dll import/export in your .h), and the *define* them without dll import/export (in your cpp).
  12. Replies
    8
    Views
    504

    Re: anonymous namespace qualifier

    I see. That's interesting.

    Well, I think I have my answers in regards to the original issue. Thanks all.
  13. Replies
    2
    Views
    3,431

    Re: please explain output

    Sounds like homework. In any case, it's a simply recursive calls crazy in a tree like fashion, "in-order".

    Simply tracing your code with a pen and paper would help here:




    ...
  14. Replies
    8
    Views
    504

    Re: anonymous namespace qualifier

    With my MinGW, both std=c++98 and std=C++11 produce the same output. Were namespace rules changed with C++11? I am not aware of any changes being made to them with this latest release. Are you...
  15. Replies
    8
    Views
    504

    Re: anonymous namespace qualifier

    Yeah, but it still creates a block you have to track where it opens and closes. Not a huge deal, I agree, but it feels a bit messy.



    Really? Because that doesn't compile for me...

    Using GCC.
  16. Replies
    8
    Views
    504

    anonymous namespace qualifier

    It has recently been brought to my attention that it is possible to use a namespace as a "qualifier" in the signature of a definition as opposed to using a block. EG:


    //Begin declarations here...
  17. Replies
    5
    Views
    516

    Re: initializing a POD bitfield struct

    Nice link.



    Thank you very much (both). That was a real complete and helpful answer.
  18. Replies
    5
    Views
    516

    Re: initializing a POD bitfield struct

    Well, S isn't necessarily something I own. And if at all possible, I'd rather it stay a POD.
  19. Replies
    5
    Views
    516

    initializing a POD bitfield struct

    I'm wondering what is the "best" way to initialize a bitfield struct. I have this bitfield, defined as:


    struct S
    {
    unsigned int a : 1;
    unsigned int b : 1;
    };

    If I'm "using" the...
  20. Re: Pasting "-" does not give a valid preprocessing token

    Interesting. Good point.



    Ah... Now THERE is a good solution... Unfortunately, I gave you a reduced use case. Inside actual code, the "-" is (potentially) at call site:


    std::cout <<...
  21. Pasting "-" does not give a valid preprocessing token

    I'm porting a macro from VS to GCC. The macro is pretty trivial: Take A and B, and create "A-B":


    #include <iostream>

    #define QUOTE1(A) #A
    #define QUOTE2(A, B) QUOTE1(A##-##B)

    int main()
    {
  22. Replies
    6
    Views
    733

    Re: Struct with internal linkage

    That'd be my "go to" solution, if it was legal C++.

    GCC gives:
    error: a storage class can only be specified for objects and functions

    VStudio compiles, but emits:
    warning C4091: 'static ' :...
  23. Replies
    6
    Views
    733

    Re: Struct with internal linkage

    Derp.

    Thanks.
  24. Replies
    6
    Views
    733

    Struct with internal linkage

    Hi all (long time no see)

    I've been wondering about something for a while:

    Is it possible to declare a struct/class, in a cpp file, designed for local use, but with internal linkage?

    The...
  25. Replies
    4
    Views
    485

    Re: A question regarding try/catch

    You could try the "update the return value as you go" scheme:



    ReturnType foo()
    {
    ReturnType return_val = a;
    try{
    return_val = b;
    if...
Results 1 to 25 of 2000
Page 1 of 80 1 2 3 4


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center