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.22 seconds.

  1. Re: LNK2019 linker error when initializing an object

    For templates, the definition needs to be in the .h file - not declaration in the .h file with the definition (body) in a .cpp file as you have in post #1
  2. Replies
    1
    Views
    752

    Re: VB.net Slots game bug? behaving oddly

    [Also asked here https://www.vbforums.com/showthread.php?902874-VB-net-Slots-game-bug-not-easily-apparent ]
  3. Replies
    5
    Views
    1,184

    Re: Is this valid for printf (in MSVC)

    It's always been like that except that "%lf" came with c99/C++11 when long double was introduced. Note that that MS VS double and long double are the same.

    PS. Why are we both working on a Sunday...
  4. Replies
    5
    Views
    1,184

    Re: Is this valid for printf (in MSVC)

    Yes. See:



    int main() {
    printf("%+05.1lf\n", 1.456);
    printf("%+05.1lf\n", 123.456);
    printf("%+05.1lf\n", -13.456);
    }
  5. Re: if statement being ignored despite conditions being true

    Not always. Skipping of initial white-space with >> for a char can be compiler dependent. With MS VS2022 this works OK:



    #include <iostream>

    int main() {
    int i {};
    char ch {};
  6. Re: if statement being ignored despite conditions being true

    Consider as code refactored to use functions etc. This is OK with VS2022:



    #include <iostream>
    #include <cstdlib>

    constexpr size_t noQuest { 10 }; // Number of questions
    constexpr int...
  7. Re: ShellExecute tries to launch .exe everytime even though it is already runniong.

    You could also consider using a pipe
    https://learn.microsoft.com/en-us/windows/win32/ipc/named-pipes
  8. Replies
    1
    Views
    4,282

    Re: Collaborate on ideas/applications?

    [Also see https://www.vbforums.com/showthread.php?902583-Why-are-there-no-cooperative-areas-here-Or-are-there&p=5631675#post5631675 ]

    There is this forum for Programming Projects.
  9. Replies
    2
    Views
    1,033

    Re: Too memory used by the stack

    The sizes of the used arrays are large. That's why it's exceeding the stack limit as these are allocated on the stack. Probably the easiest way to allocate these off the stack is to make them global...
  10. Re: Using npcap libs to save packet causes memory fault

    The in parameter requires a 16-bit number in TCP/IP network byte order. As the cast is from char* to u-short* the order of bytes ptrCurrent_Field[0] and ptrCurrent_Field[1] is important and isn't...
  11. Re: Using npcap libs to save packet causes memory fault

    Watch endiness!
  12. Re: Using npcap libs to save packet causes memory fault

    Then



    shortTTL = ntohs(*ptrCurrent_Field);


    assuming that ptrCurrent_Field is not NULL and is valid.

    Sorry my bad/mistake. See Salam's post below. I misread the previous post for the...
  13. Re: Using npcap libs to save packet causes memory fault

    ntohs() requires a u_short param (unsigned) and not a short (signed). So try:



    shortTTL = ntohs((u_short)*ptrCurrent_Field);


    Assuming that ptrCurrent_Field isn't of void*. What is the type...
  14. Re: Using npcap libs to save packet causes memory fault

    That depends upon what the used api documentation says. You don't provide any code for us to have a look at.
  15. Replies
    3
    Views
    2,526

    Re: Searching for something in visual basic vb6

    For VB6, you'd probably be better off using our sister vbforum site.
    https://www.vbforums.com/forumdisplay.php?1-Visual-Basic-6-and-Earlier

    If you just want VB6 on this codeguru forum, then...
  16. Replies
    1
    Views
    2,781

    Re: IT en freelance et Portage salarial

    As translated:

    Hello community,

    I am interested in salary portage as a freelance IT specialist and I am trying to understand if this model can be a viable alternative to other forms of...
  17. Re: how to connect to a pin machine in my vb6 invoice software?

    [Also asked here https://www.vbforums.com/showthread.php?902023-how-to-connect-to-a-pin-machine-in-my-vb6-invoice-software&p=5626242#post5626242 ]
  18. Replies
    2
    Views
    2,145

    Re: 'access()' and "%20" strings

    For MS Windows, the function is _access() as access() isn't a c-standard but Posix. But AFAIK this also doesn't understand %n. Apart from access(), what other functions does the program use that...
  19. Replies
    3
    Views
    1,868

    Re: Do not receive focus events in console

    No. You don't need threads. I just pasted as an example some of my code which is within a thread and explained why a queue is used. Where it uses wait_enqueue() just directly use the char. Alter the...
  20. Replies
    3
    Views
    1,868

    Re: Do not receive focus events in console

    Well this is based upon how I do this. I use client/server with a shared circular buffer. This code is part of the console server and obtains chars from the keyboard and puts them in the buffer and...
  21. Replies
    3
    Views
    3,782

    Re: Constructor for derived class

    Is this a class exercise? See https://cplusplus.com/forum/general/285683/ where this question has been asked and answered previously.
  22. Thread: Sqlite / C++

    by 2kaud
    Replies
    5
    Views
    6,874

    Re: Sqlite / C++

    Is this helpful
    https://sqlite.org/forum/info/09d27e962aa890b9

    This if for VB but see the discussion re why this error happens and how to fix it....
  23. Replies
    1
    Views
    2,786

    Re: Implicit conversion loses integer precision

    It looks like for OSX long uses more binary bits than for an int. For Windows int is 32 bit and so is long. For 64 bit you need long long. For OSX long may be 64 bit. Use long for the value read...
  24. Re: Given a list of sorted lists, return a merged sorted list

    If you have to 'roll your own' merge, then using insert_after as suggested by salem_c above consider:



    #include <forward_list>
    #include <iostream>
    #include <algorithm>
    #include <iterator>
    ...
  25. Re: Given a list of sorted lists, return a merged sorted list

    OK. Then consider:


    int main() {
    intLst l1 { 1, 5, 6 }, l2 { 4 }, l3 { 2,3,7,8 };

    l1.merge(l2);
    l1.merge(l3);

    std::ranges::copy(l1, std::ostream_iterator<int>(std::cout, " "));
Results 1 to 25 of 2000
Page 1 of 80 1 2 3 4





Click Here to Expand Forum to Full Width

Featured