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

Search:

Type: Posts; User: GNiewerth

Page 1 of 55 1 2 3 4

Search: Search took 0.07 seconds.

  1. Replies
    27
    Views
    6,513

    Re: Stack/Queue Question

    Correct. But you can typedef them. And you should prefer composition over of private inheritance because a stack isnīt a list.



    template<typename T>
    class StackMio
    {
    public:
    typedef...
  2. Thread: C++ syntax

    by GNiewerth
    Replies
    3
    Views
    564

    Re: C++ syntax

    Itīs the ternary operator, itīs syntax is "exp ? A : B". When the exp evaluates to true, its return value is A, else itīs B.
  3. Replies
    9
    Views
    2,863

    Re: vector vs. deque

    Iīd like to add that deque has a larger overhead than vector, this can be a serious problem if you need to store huge amounts of data, especially with small data types. At least STLport and...
  4. Replies
    25
    Views
    2,870

    Re: Self deteting EXE

    The easiest way:
    The installer creates a registry entry containing the date of installation (maybe the prgram itself when itīs first run). Upon every start you check the current date against the...
  5. Replies
    25
    Views
    2,870

    Re: Self deteting EXE

    This will fail when the user installs the program, enters the license data and sets the system clock back to 1970...
  6. Replies
    25
    Views
    2,870

    Re: Self deteting EXE

    In conclusion itīs pretty pointless to delete the executable, because you cannot prevent the user from making a backup and running it over and over again. If you want to make sure the program cannot...
  7. Re: finding 2 elements in one vector iteration

    Since I donīt know what your data looks like I chose the type T for the data stored in the vector and type U for the find criteria. const is just a promise not to alter the variables during the...
  8. Replies
    25
    Views
    2,870

    Re: Self deteting EXE

    No, itīs impossible for an application to delete its executable (at least on Windows).
    This issue is usually solved by a patcher application, the patcher first checks and performs updates and then...
  9. Replies
    5
    Views
    640

    Re: File size in bytes

    Since you mentioned the Win32 API you might consider GetFileSize or GetFileSizeEx.
  10. Re: finding 2 elements in one vector iteration

    Basic approach:



    bool find( const std::vector<T>& v, const U& crit1, const U& crit2 )
    {
    bool found1 = false;
    bool found2 = false;

    for( std::vector<T>::const_iterator it =...
  11. Replies
    3
    Views
    463

    Re: contrasting pointers from non-pointers

    You missed one level of indirection. A pointer is a variable which stores one address, itīs not the address itself. So using the pointerīs "value" means accessing a specific memory location.
    Each...
  12. Replies
    5
    Views
    1,198

    Re: Networking with STL

    No, there arenīt.
  13. Replies
    2
    Views
    359

    Re: Strange memory error

    Instead of using raw C-style arrays for temporary variables you should seriously consider using std::vector instead.
    I took a glance at your code and noticed some strange things:

    - inverseDCT
    1)...
  14. Replies
    20
    Views
    1,196

    Re: [c++]code executon

    Not sure how other compilers deal with that issue, but MS compilers handle the individual expressions in an if clause as sequence points if they&#180;re combined by && or ||. This guarantees that the...
  15. Replies
    6
    Views
    1,464

    Re: Rock, ..., Spock Random Numbers

    I donīt know how my "friends" decided, theyīre actually the four guys from the TV Series "The Big Bang Theory". :p
  16. Re: Question about structs in class which wouldn't save value.

    Since copying a std::string object might be expensive changing the ret_b() method to



    const std::string& Sam::ret_b() const
    {
    return b;
    }
  17. Thread: overload

    by GNiewerth
    Replies
    11
    Views
    1,054

    Re: overload

    1) You can eliminate the necessity of a copy constructor/assignment operator by using std::vector instead of a C-style array.

    2) binary operators (i.e. operator+) should be implemented as...
  18. Replies
    6
    Views
    1,464

    Re: Rock, ..., Spock Random Numbers

    Empirical investigations showed that all subjects always chose Spock (at least the four guys I know of), so picking lizard always wins ;)
    What do you think about an algorithm that uses a range of...
  19. Replies
    2
    Views
    806

    Re: RAM memory consumption

    If youīre targetting Windows there are two API functions GlobalMemory/GlobalMemoryEx that return the systemīs memory statistics.
  20. Replies
    7
    Views
    780

    Re: Numbering entries in a data file

    std::map is a container that stores key/value pairs. In this case the key type is an unsigned int (the contact ID) and class Contact (the contact data itself). Basically it looks like a table...
  21. Replies
    7
    Views
    780

    Re: Numbering entries in a data file

    Ok, I see. In that case std::map is the container of your choice, because it makes the search for the next free ID much simpler and efficient than std::vector. Please look at this example:


    ...
  22. Replies
    7
    Views
    780

    Re: Numbering entries in a data file

    1) Does it make sense to store all your data in memory and occasionally save the whole data? You could perform all changes in RAM and don&#180;t have to bother with fragmentation or holes.
    2) Is it...
  23. Replies
    8
    Views
    987

    Re: c++ to launch a program

    You can either omit the batch file at all and follow the approach I advised in my previous approach or specify a window coordinate where the command window cannot be seen. Use the dwX, dwY and...
  24. Replies
    8
    Views
    987

    Re: c++ to launch a program

    That cannot be done with C++, you have to use the Win32 API (which should be available since you want to start the target application in Win98 compatibility mode). Your problem can be solved with 3...
  25. Replies
    4
    Views
    668

    Re: choose implementation at link time

    The only solution I can think of are preprocessor conditionals (#ifdef/#else/#elif/#endif), though I seriously donīt recommend using them.
Results 1 to 25 of 1367
Page 1 of 55 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