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

Search:

Type: Posts; User: Kheun

Page 1 of 80 1 2 3 4

Search: Search took 0.57 seconds.

  1. Replies
    7
    Views
    1,423

    Re: Validating an email address error

    Well, in your first code within IsValidEmail(), it always return the boolean result from Regex.IsMatch().
  2. Thread: RMS an array

    by Kheun
    Replies
    3
    Views
    3,867

    Re: RMS an array

    Is RMS referring to Root Mean Square? If so, you should multiply each element by itself before summing them. I.e. runningWindowCount = array[i] * array[i]

    From you question, I believe you are...
  3. Replies
    7
    Views
    1,311

    Re: Using an undefined class?

    There's nothing wrong in writing neutral network code in OOP. Your header file seem okay except for the function signature for CNeuron::Attach(). There is no need to use the class keyword for pLayer...
  4. Re: Is this even possible? (don't need solution, just a yes or no)

    There's nothing wrong with the question. It is achievable using a for-loop. You just need to count from start to end.
  5. Replies
    23
    Views
    15,371

    Re: Using goto in c++ code

    I don' think I will ever use goto in C++ as there are multiple ways to avoid it and still writing clean code. However, it will be a different story when the programming language of choice is C. It is...
  6. Re: casting Class to Class

    Is this what you are looking for?



    inline const A1<T>& GetA() const // <<<<<<<<
    {
    return a; // <<<<<<<<<<
    }
  7. Re: Defining a macro to disable warnings with pragma

    Thanks for clearing up.

    I found this link that may help but I haven't tried it.
    http://msdn.microsoft.com/en-us/library/d9x1s805.aspx
  8. Re: Defining a macro to disable warnings with pragma

    I doubt so. As far as I know, #pragma preprocessor directive is compiler specific. I don't think it is part of the C++ language.
  9. Replies
    12
    Views
    1,230

    Re: .cpp and .h file not compiling

    As long as you are using a recent compiler, you have to use the full name, like std::cout and std::cin. Otherwise, you need "using namespace std" in your code. One unlikely possibility is that you...
  10. Replies
    12
    Views
    1,230

    Re: .cpp and .h file not compiling

    Please see this FAQ.
    http://www.codeguru.com/forum/showthread.php?t=396141
  11. Thread: vc++ error

    by Kheun
    Replies
    5
    Views
    941

    Re: vc++ error

    I think the information provided may be incomplete. Since that the binary doesn't work in other locations, you may like to take a look in your code with files are being handled.
  12. Thread: Array problem

    by Kheun
    Replies
    1
    Views
    676

    Re: Array problem

    You print out the wrong content. Variable b is your index and use myarray[b] to retrieve the value of each element in the array.




    cout << "myarray [" << b << "] = " << myarray[b] << "\n";
  13. Re: headers and static lib: unwanted memory shift ?

    You should keep the header file the same, otherwise the compiler will think that the size of your class is smaller than actual.

    If you want to hide some details in the your class from others, you...
  14. Replies
    12
    Views
    1,230

    Re: .cpp and .h file not compiling

    And constructor implementation is not correct...



    Class::Class()
    {
    }
  15. Re: Defining a macro to disable warnings with pragma

    _Superman_, the problem is not about writing a macro but on using preprocessor to suppress warning messages from the compiler on certain part of the code. One example would be reusing a legacy code...
  16. Replies
    23
    Views
    15,371

    Re: Using goto in c++ code

    The most important thing to me is code readability. As long as any approach generate a clean code, I will use it. In C++, I will never thought of using goto at all because the language has better...
  17. Re: Testing tools for my game server - any recommendations?

    I think you are taking the right path in automating client to stress testing your server. In addition, you can create a console mode for your client to tale commands and avoid rendering graphic. In...
  18. Replies
    2
    Views
    689

    Re: Implicit conversion operators

    For you example, you should also provide the operator[]() instead of operator*(). Otherwise, the compiler will be confused with the native "float operator[](size_t)".



    template<typename T,...
  19. Replies
    9
    Views
    1,679

    Re: Are #defines evil?

    To quick work around is to use #undef to undefine the macro in your cpp file. As long as the const is being defined as private in the cpp file, it shouldn't conflict with the rest of the code.
  20. Replies
    5
    Views
    947

    Re: Check if a program runs?

    You can create an interprocess semaphore object. When the first program starts, it creates an interprocess semaphore with an unique name. When subsequent instances of the same program is launched,...
  21. Thread: do-if-else

    by Kheun
    Replies
    3
    Views
    664

    Re: do-if-else

    How did you declare the final variable? If you declare it as std::string, then the comparison will work.

    As for your other problem, your do-while statement is not right. In all while statement,...
  22. Re: illegal call of non-static member function -help-

    Please see the line highlighted in red. I believe you made a mistake by declaring a pointer and ended up passing an uninitialized pointer to the function, SRRT::Exp_princ().



    bool SRRT::Plan()...
  23. Replies
    2
    Views
    1,666

    Re: Read complex data from binary file

    You can't just write the entire instance into file and vice versa especially when the message class has member declared as pointers which you have to allocate and deallocate memory. So when you write...
  24. Replies
    15
    Views
    2,038

    Re: Template Method Question

    Here's a quick example.



    class ReportGenerator
    {
    //...
    public:
    void doIt()
    {
  25. Re: shift count negative or too big, undefined behavior

    In C99, it also supports int64_t for 64-bit int. So you may like to create a temporary typedef for int64_t so that when Visual C++ finally supports it, you will not have to change much of your code....
Results 1 to 25 of 2000
Page 1 of 80 1 2 3 4





Click Here to Expand Forum to Full Width

Featured