Search Results - CodeGuru Forums
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.15 seconds.

  1. Replies
    14
    Views
    3,786

    Re: vectors of vectors of different types...

    A simple way of doing this is to store all data as strings and have a type field to indicate whether the row should be treated as chars or as numeric. Something like


    struct Rdata
    {
    bool...
  2. Replies
    5
    Views
    557

    Re: Anyone upgraded to Windows 10 yet ??

    To get the control panel, in the 'Search Web and Windows' area, just type control. You'll see Control Panel as one of the found options. Same for add/remove programs. This is now Apps and Features in...
  3. Replies
    5
    Views
    557

    Re: Anyone upgraded to Windows 10 yet ??

    If you want to upgrade now, follow this link http://www.microsoft.com/en-us/software-download/windows10

    This will either allow you to upgrade the computer from which it is run or to download a...
  4. Replies
    3
    Views
    292

    Re: (Begginer) problem with sum c++

    suma[ii]=+abc[ii].v[ii];



    You are not initializing the elements of suma before trying to calculate the sum.



    //cout <<suma[1][1]<< " ";
    //duomenis pajema po kableliu pirma syki
  5. Replies
    3
    Views
    168

    Re: Assignment operator question

    This is due to the comma operator. See http://stackoverflow.com/questions/54142/how-does-the-comma-operator-work for further details.
  6. Thread: Multithreading

    by 2kaud
    Replies
    5
    Views
    349

    Re: Multithreading

    c++11 now has in-built multi-threading. Details can be found at http://www.cplusplus.com/reference/multithreading/ - though this is more a reference than a tutorial. I would also suggest you consider...
  7. Replies
    13
    Views
    377

    Re: [RESOLVED] Wrong output with pointers

    You can also undertake a palindrome check without first having to reverse the word - and by only checking half of the string! Consider


    bool is_palindrome(const char* p)
    {
    const char *e { p };...
  8. Replies
    13
    Views
    377

    Re: [RESOLVED] Wrong output with pointers

    Your code is quite inefficient. len() iterates over the string and then you again iterate over the string. Also accessing via a pointer is more efficient than accessing via an index (timings with...
  9. Replies
    13
    Views
    377

    Re: Wrong output with pointers

    This assumes that the length of the strings pointed to by c and p are the same (or at least string length p is not less than string length c).
  10. Replies
    13
    Views
    377

    Re: [RESOLVED] Wrong output with pointers

    if (p == c) return true;


    you are comparing pointers (ie the memory addresses) which in this case will always be different - rather than the data to which they point. If you want to compare the...
  11. Replies
    25
    Views
    19,270

    Re: Relationship is-a, has-a and uses-a

    Are you using 'standard' c++ or managed c++/c++ CLI? It sounds like you're using managed c++ in which case there is another dedicated forum for that...
  12. Re: C++ Semaphore, limit 2 instances at the same time

    One way to do this could be


    #include <stdio.h>
    #include <Windows.h>

    const int MAXTHREAD = 2;
    const int THREADS = 10;

    struct structure1 {
  13. Replies
    12
    Views
    347

    Re: edit box changes color

    Probably not. That's why you have the issue. :) Within myWindowProc() for messages not handled (and for those handled but you also want to be handled by the control) you need to call the default...
  14. Replies
    12
    Views
    347

    Re: edit box changes color

    What does myWindowProc() actually do? It could be helpful if you posted the code.
  15. Replies
    9
    Views
    462

    Re: My problem with pointers

    What if a was initialised to a longer set of chars eg char a[] = "string"; ? c/c++ provides a comprehensive library for functions relating to c-style null terminated strings. See...
  16. Replies
    8
    Views
    470

    Re: win32 - how scrooling a window?

    Your code uses 2 'magic numbers' each for x and y.



    SCinfo.nMax =ws.y - rtcParent.bottom + GetSystemMetrics(SM_CYHSCROLL) + 7;
    ...
    SCinfo.nPage=SCinfo.nMax / 5;
    ...
    SCinfo.nMax =ws.x -...
  17. Replies
    2
    Views
    264

    Re: Binary Tree Problem

    As this seems to be a homework assignment, we won't provide the code for you. See http://forums.codeguru.com/showthread.php?366302-Visual-C-General-Can-you-help-me-with-my-homework-assignment

    Once...
  18. Replies
    10
    Views
    468

    Re: casting smart pointer

    This compiles without any error using MS VS2015. :( (only warning C4700: uninitialized local variable 'p' used).
  19. Replies
    25
    Views
    19,270

    Re: Relationship is-a, has-a and uses-a

    Very true. :thumb:
  20. Replies
    25
    Views
    19,270

    Re: Relationship is-a, has-a and uses-a

    In this example, class d is-a b and also has-a b. class b is a base class and class d is derived from b and also has a member variable which is of type b.



    #include <iostream>
    using namespace...
  21. Re: Pass reference to string as default parameter

    For c++11, this works with MSVS 2015



    typedef basic_string<char> bstring;

    void byref(bstring& bst = bstring("default"))
    {
    cout << bst << endl;
    bst = "qwerty";
  22. Replies
    3
    Views
    283

    Re: Two Beginner Questions

    Sorry, I transcribed it incorrectly waiting for a compiler build :o. It should be


    else if (answer == 't') {
    if (p2.maxTextsreached())
    p2.txt(p1);
    }


    as...
  23. Replies
    3
    Views
    283

    Re: Two Beginner Questions

    displaySummaryInfo() shouldn't be a class member function. Within the class provide getter functions for nlive and ntext.

    maxTextsreached() does what it is supposed to do. The issue is with how...
  24. Replies
    6
    Views
    332

    Re: how use GetProp() and SetProp()?

    SetProp(parent, "parent", (HANDLE)parent);//creates? and sets property


    This doesn't seem to make sense. You are setting the value of property "parent" of a window to itself???????

    Don't you...
  25. Replies
    1
    Views
    243

    Re: Two newbie C++ related questions

    anything which is defined in the std namespace (eg containers, streams, algorithms etc etc) - see http://www.cplusplus.com/reference/



    you don't. For switch you have to test on equality (or...
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.com survey!


HTML5 Development Center