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

Search:

Type: Posts; User: LanTHrusteR

Page 1 of 4 1 2 3 4

Search: Search took 0.03 seconds.

  1. Replies
    14
    Views
    1,056

    Re: const string some = "in header";

    Thank you for the suggestion.

    I think we found the correct answer to the problem:

    The global variables are placed in the static memory. The global variables placed in the static memory are...
  2. Replies
    14
    Views
    1,056

    Re: const string some = "in header";

    It is created, we have double checked it. The string object is created but not yet initialized (wierd)...
  3. Replies
    14
    Views
    1,056

    Re: const string some = "in header";

    Yes, we did something like
    extern string ENV_VAR;

    in the header.

    and then initialized it in the CPP file. But the CPP files are not necessarily used by the other developers and most of our...
  4. Replies
    14
    Views
    1,056

    Re: const string some = "in header";

    I can't possibly do it. The project is rather huge.
    Imagine you have 12 libraries.

    You have a header from some library where you do something like

    header.h
    namespace nm{
    const string...
  5. Replies
    14
    Views
    1,056

    Re: const string some = "in header";

    Of course it is global. And we do not want to change it anyway. There is no pointer. We define in our header

    const string SOME_OUR_CONST = "SOME_MEANINGFUL_FOR_US_STRING";

    and then somewhere...
  6. Replies
    14
    Views
    1,056

    const string some = "in header";

    The problem we are dealing with is that in some conditions (we cannot yet define them exactly) string" some" would be empty.

    i.e. if we define

    const string MY = "SOME MACRO";

    and the...
  7. Thread: const

    by LanTHrusteR
    Replies
    30
    Views
    2,834

    Re: const

    Thanks!!! I got it now. I just thought that there was some standard restrictions on declaring top-level const objects....
  8. Thread: const

    by LanTHrusteR
    Replies
    30
    Views
    2,834

    Re: const

    Thanks. Now the reasons are perfectly clear... (Let's hope the implementer will never look into implementation :-))
  9. Thread: const

    by LanTHrusteR
    Replies
    30
    Views
    2,834

    Re: const

    Ah, I just thought that it is ignored as a qualifier... sorry.
  10. Thread: const

    by LanTHrusteR
    Replies
    30
    Views
    2,834

    Re: const

    I know that. I was just trying to find the reason why one should declare
    void func(int x); first and then defining void func(const int x); to disallow x modificaton instead of just living with void...
  11. Thread: const

    by LanTHrusteR
    Replies
    30
    Views
    2,834

    Re: const

    Hm, I don't understand something here this code will compile under g++ and VC7



    int func(const int x){
    return 2;
    }
    int main()
    {
    int c=5;
  12. Replies
    4
    Views
    614

    Re: Compile on Windows for Linux

    Yes, it is possible. Apart from using a virtual computer you may use something like Visual MainWin. But the best way is just to have a linux box at hand.
  13. Replies
    18
    Views
    1,688

    Re: multi dimensional array at runtime

    There is an old technique that is the fundamental base for understanding the numeric part of STL. You might find it useful.

    Here is an example:

    Consider the following 3x3 array.

    1 2 3
    4 5...
  14. Thread: for_each

    by LanTHrusteR
    Replies
    2
    Views
    591

    Re: for_each

    No, you should use a different algorithm.

    Depending on the situation use find_if or search with user defined predicate.

    Consider..

    for_each means that some action has to performed for each...
  15. Replies
    3
    Views
    1,430

    Re: Decorator pattern

    Here is an example from RSDN



    #include <iostream>
    using std::cout;
    using std::endl;

    class IWidget
    {
  16. Replies
    9
    Views
    882

    Re: erasing elements from a map

    He is finding all _adjacent_ elements the difference between the first numbers of which is less than 'num'.

    When the pair is found he has to decide which one of the found sequence he should...
  17. Replies
    11
    Views
    1,064

    Re: Problem with string

    Since the task stated in MAY or MAY BE NOT style below is one of the possible solutions that may or may not be what you want.
    It is in C++.



    #include <string>
    #include <iostream>
    using...
  18. Replies
    8
    Views
    13,130

    Re: How to use __FUNCTION__ macro in VC6.0?

    Check out this link

    http://www.codeproject.com/useritems/xtrace.asp
  19. Re: What was the reason for making non-virtual desturctors for the std containers?

    Thanks!!! Yes, that is exactly the point. I don't always see how the nature could be expressed in C++. Sometimes I can not distinguish whether the water extends molecule of water or the water is a...
  20. Re: What was the reason for making non-virtual desturctors for the std containers?

    To dervie means to extend. So logically everything I extend could be derived. And the choice between - do the bricks extend the foundation or the foundation consists of bricks is not an easy one for...
  21. What was the reason for making non-virtual desturctors for the std containers?

    I beg your pardon if the question is trivial.

    Personally I can think of many reasons why the std destructors were not made virtual, yet I can give some reasons why they should have been made this...
  22. Replies
    17
    Views
    3,250

    Re: Array Inversion??

    Reversing vectors is not efficient. That is the reason why standard vector doesn't have reverse member function and std::list does.

    Unfortunately the source data is a C style array and I don't...
  23. Replies
    15
    Views
    1,554

    Re: Covert Char [128] to Char *[16]

    Just another working remake of the same code


    #include <string>
    #include <vector>
    #include <algorithm>
    #include <iostream>

    using std::string;
    using std::vector;
  24. Replies
    6
    Views
    16,500

    Re: printf("0x%.2X",HEX)

    "0x%.2X"
  25. Re: P.J. Plauger, a peculiar STD container design..

    Hm, I think it is done to differentiate between iterator's pointer type and container's pointer type.


    ....................
    class const_iterator
    : public _Ranit<_Ty, _Dift,...
Results 1 to 25 of 77
Page 1 of 4 1 2 3 4





Click Here to Expand Forum to Full Width

Featured