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

Search:

Type: Posts; User: 2kaud

Page 1 of 80 1 2 3 4

Search: Search took 0.05 seconds; generated 29 minute(s) ago.

  1. Replies
    2,370
    Views
    1,042,521

    Re: The Boring Thread

    Well either it's a really boring party or this thread isn't meeting it's objectives........
  2. Replies
    3
    Views
    187

    Re: Palindrome Problem in C++

    #include <iostream>
    #include <iomanip>

    bool checkPalindrome(unsigned original) {
    unsigned reverseNum {};

    for (auto tempOriginal {original}; tempOriginal > 0; tempOriginal /= 10)...
  3. Re: What's wrong with my std::ostringstream usage

    We've all made stupid mistakes at least once, twice...
  4. Re: How to get file permissions that are associated with a file?

    Do you mean file permissions or file attributes? These are quite different.
  5. Replies
    1
    Views
    209

    Re: Visual Studio 17.1 vs 17.2 preview

    See https://docs.microsoft.com/en-us/visualstudio/releases/2022/release-notes-preview
  6. Replies
    3
    Views
    653

    Re: Aspect and format of the console

    You can't change the buffer size to be less than the size of the console window. Note that there are two sizes - the size of the buffer and the size of the window. The window is a 'picture' of the...
  7. Replies
    2
    Views
    272

    Re: Python: Querying Data by Sound

    Have fig 1 and fig 2 been transposed?

    Interesting article.

    I hadn't come across Double Metaphone before. In the 1980's/90's I used soundex extensively when querying data files. The top...
  8. Thread: stop a thread

    by 2kaud
    Replies
    6
    Views
    674

    Re: stop a thread

    You can't cleanly terminate a thread without assistance from the thread. You can terminate a thread using TerminateThread() - but that has issues. The usual way is to use event which is set by the...
  9. Replies
    2
    Views
    657

    Re: decltype accepting two parameters?

    decltype() does only accept one param. In your example



    decltype((x == nullptr), get_object(*x))


    decltype() has only one param get_object(*x). , is the comma operator so that the...
  10. Thread: File I/O

    by 2kaud
    Replies
    10
    Views
    735

    Re: File I/O

    As vecOfStrs is std::vector<std::string>, the number of chars used for each entry is not the same. Also the data is stored in dynamic memory so sizeof() doesn't give the number of bytes stored for an...
  11. Thread: File I/O

    by 2kaud
    Replies
    10
    Views
    735

    Re: File I/O

    What are you trying to accomplish?? Based upon the provided code:



    #include <fstream>
    #include <iostream>
    #include <string>
    #include <vector>
    #include <exception>
  12. Replies
    2
    Views
    419

    Re: Issue with array of objects

    When posting code, please use code tags so that the code is readable. Go Advanced, select the formatted code and click #

    Friend is a class that stores the data for a friend. It is not a collection...
  13. Thread: File I/O

    by 2kaud
    Replies
    10
    Views
    735

    Re: File I/O

    #include <iostream>
    #include <fstream>
    #include <string>
    #include <vector>

    bool getFileContent(const std::string& infileName, const std::string& outfileName, std::vector<std::string>&...
  14. Replies
    8
    Views
    1,222

    Re: How to post articles on Codeguru?

    See my post above re PM jamespayne. You can't directly publish an article.
  15. Replies
    8
    Views
    1,222

    Re: How to post articles on Codeguru?

    @srilatha0515 If you are interested in submitting articles, I suggest you PM jamespayne
  16. Thread: OOP Basics

    by 2kaud
    Replies
    3
    Views
    476

    Re: OOP Basics

    This is default value initialisation. If there's no value between the {} the variable is initialised to the default value for the type of the variable - which is 0 for long. It's good practice to...
  17. Thread: OOP Basics

    by 2kaud
    Replies
    3
    Views
    476

    Re: OOP Basics

    What is out_buffer?

    I'm not sure what you're trying to achieve. Perhaps you could be more explicit in the requirements? However consider:



    #include <iostream>

    class Message {
    public:
  18. Replies
    4
    Views
    863

    Re: Basic Dynamic Programming code

    ... and also a mix of C++ and C !
  19. Re: INI file library checking for duplicates, missing, backing then replace?

    [requested changes made]
  20. Replies
    4
    Views
    863

    Re: Basic Dynamic Programming code

    Use the debugger to trace through the code and watch the variables. When the debugger shows behaviour different from that expected from the design then you have found an issue.
  21. Re: CStatic - disable double click copy to clipboard.

    clip is a handle - not a pointer to data. Once you have the handle then you need to obtain a memory pointer from it. For this use GlobalLock(clip). The return value is a pointer to the data. If not...
  22. Replies
    3
    Views
    415

    Re: 'for' loops on C++11

    Well IMO it's far better than something like:



    for (auto itr {all_triggers.begin()}; itr != all_triggers,end(); itr = std::next(itr))
    (*itr)->process_state_requests (bufs, nframes - 1);

    ...
  23. Replies
    3
    Views
    415

    Re: 'for' loops on C++11

    all_triggers is a type that supports .begin(), increment (++) and .end() . all_triggers is iterated from .begin() to .end() by incrementing an internal iterator. The iterator is de-referenced and...
  24. Re: strcmp works sometime, but not always & blocks output to screen

    gets() has been removed from the standard. use gets_s() instead. As this is C++, why not use std::string?

    You have a 'typo':



    strcpy(second, word3);
    strcpy(second, word2);
  25. Replies
    2
    Views
    1,147

    Re: Is it ok to use null checks?

    Well C++ allows null pointer (nullptr - 0). If a function returns a pointer then checking for nullptr is valid - and probably needed. The question probably isn't about checking a pointer for nullptr,...
Results 1 to 25 of 1982
Page 1 of 80 1 2 3 4





Click Here to Expand Forum to Full Width

Featured