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

  1. Thread: cpu ID

    by 2kaud
    Replies
    7
    Views
    282

    Re: cpu ID

    Yes. The processor used is determined by the scheduler when the thread is scheduled to run for its quantum. The issue of when a thread is scheduled and to which processor it is scheduled is quite a...
  2. Thread: cpu ID

    by 2kaud
    Replies
    7
    Views
    282

    Re: cpu ID

    within the confines of any applied affinity mask. See http://msdn.microsoft.com/en-us/library/windows/desktop/ms686247%28v=vs.85%29.aspx

    A processor can also be set as the preferred processor for...
  3. Re: Complete Beginner of C++ Graphics Programming(Help in simple checker game)

    When posting code, please use code tags as you did in your post #1 so that the posted code is readable.

    What values can the elements of board have? Then check for these values in the loops and...
  4. Replies
    2
    Views
    226

    Re: Re-input variables after loop ended

    It looks like you need a loop with a terminating condition of 4 bulls? You could use a do loop for this such as


    do {
    cout << "Enter 4 digits followed by a non-digit.\n";

    ...
  5. Thread: cpu ID

    by 2kaud
    Replies
    7
    Views
    282

    Re: cpu ID

    Have a look at GetCurrentProcessorNumber() http://msdn.microsoft.com/en-us/library/windows/desktop/ms683181%28v=vs.85%29.aspx
    It provides the processor number for the current thread.
  6. Re: Windows Socket makes app crash if no internet connection

    In this case because you are passing an invalid socket to send().

    Also a better way to test would be


    SOCKET Socket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
    if (Socket ==...
  7. Re: Windows Socket makes app crash if no internet connection

    You are not checking the return value of socket(), gethostbyname() and send() for errors. The return value of ALL functions should always be checked for error.
  8. Replies
    20
    Views
    1,139

    Re: Problem with maps

    Have you considered reversing the mapping ie


    map<char, int> test;
    test['d'] = 100;
    test['e'] = 101;
    test['f'] = 102;
    test['*'] = 32;
  9. Replies
    20
    Views
    1,139

    Re: Problem with maps

    Have a look at http://www.cplusplus.com/reference/algorithm/find/
  10. Replies
    20
    Views
    1,139

    Re: Problem with maps

    // it = test.find('*'); //if I comment in just this one it won't work
    // it = test.find('f'); //if I comment in just this one it will work

    you are using find wrong. See...
  11. Replies
    5
    Views
    205

    Re: Help with writing a function that sorts

    When you are using a fixed size array, it is good practice to define a const that contains the size of the array and then use this value in loops etc.


    const int arraysize = 6;
    ...
    int...
  12. Replies
    5
    Views
    333

    Re: What is wrong with my code?

    pArr = new Array1D*[_row];

    for(int i=0;i<_row;++i)
    pArr[i] = new Array1D[_col];


    You haven't specified the type to use with Array1D which takes a template argument of the type to use to...
  13. Replies
    4
    Views
    167

    Re: Slow regex issue (VS2010)

    I don't know much about regex, but I tried this code



    #include <iostream>
    #include <regex>
    #include <string>
    ...
  14. Re: What could cause a core dump at iterator pre increment??

    Yes - and then some 'bright' programmer comes along and changes the type of container from one that doesn't invalidate used iterators to one that does. Ah!!!!!!
  15. Re: What could cause a core dump at iterator pre increment??

    In c++11, erase returns an iterator to the element that follows the last element removed. This returned value is either a valid iterator or is .end() if the last element was removed.

    As erase can...
  16. Re: What could cause a core dump at iterator pre increment??

    If you are using c++11, I prefer


    for ( MyMapT::iterator iter=inMap.begin(); iter!=inMap.end(); /* nothing here */ )
    {
    if (some_criteria)
    iter = inMap.erase(iter);
    else
    ...
  17. Replies
    9
    Views
    645

    Re: Problem with lists

    When IT equals names.end() IT is 1 beyond the end of the list and elements beyond the end of list can't be de-referenced. You need to check that IT is not equal to names.end before using IT....
  18. Replies
    26
    Views
    982

    Re: Problems with operator overloading

    Complex1 operator + (const Complex1 & lhs , const Complex1 & rhs)
    {
    Complex1 temp(rhs);

    return temp += rhs;
    }


    rhs + rhs ??? :confused:
  19. Replies
    26
    Views
    982

    Re: Problems with operator overloading

    What functions have you declared/defined for the operator >> ?

    Note that there is already a STL complex class called complex. See http://www.cplusplus.com/reference/complex/
  20. Thread: JAVA assignment

    by 2kaud
    Replies
    3
    Views
    634

    Re: JAVA assignment

    As I mentioned in my post #2, please post your java code to the java forum. Also use code tags when posting code. Go advanced, select the code and click '#'.
  21. Re: Ordering 1000 numbers in one single line, all separated by a comma

    Yes, as attached. However as a simple programming exercise why not take the attached file in my post #3 and simply convert it? The processing is trivial.

    32991
  22. Replies
    2
    Views
    568

    Re: Beginner Lab help

    Decimal digits are based around numbers to the base 10. So if we take the number 4567 then we have
    7 * 1 + 6 * 10 + 5 * 100 + 4 * 1000
    If we now consider the powers of 10 we find
    0 1
    1 10
    2...
  23. Re: Extension DLL callback function used for a Windows service and write to file

    You need to use two backslashes in a string when one is required. Try


    file.open("C:\\dir\\to\\file", ios:out);


    See http://msdn.microsoft.com/en-us/library/6aw8xdf2.aspx
  24. Thread: JAVA assignment

    by 2kaud
    Replies
    3
    Views
    634

    Re: JAVA assignment

    Well you should have started it earlier!

    Please see http://forums.codeguru.com/showthread.php?366302-Visual-C-General-Can-you-help-me-with-my-homework-assignment

    Nobody here is going to the...
  25. Re: What is single-user mode/multiple-user mode of an application?

    Different hashtags simultaneously updating the same data? As OReubens said in post #14, Twitter made their design in such a way to hard avoid the multiuser conflict issues entirely.

    IMO of more...
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 survey question.


Featured


HTML5 Development Center