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

Search:

Type: Posts; User: Moschops

Page 1 of 5 1 2 3 4

Search: Search took 0.02 seconds.

  1. Replies
    26
    Views
    3,759

    Re: Opinions about programming styles

    Which matches my comment exactly. If the code carries a guarantee that it will never be read by a human, you can do whatever you like with it. I am yet to encounter any code for which such a...
  2. Replies
    26
    Views
    3,759

    Re: Opinions about programming styles

    Sounds like they're begging to be put inside a single structure named something like currentState which is then passed by reference where needed.



    Space is free. The compiler charges nothing.
    ...
  3. Replies
    9
    Views
    2,187

    Re: Parse C++ function

    Yes, there is a way to tell incorrect code; you can write the code and then use a program called a compiler on it. The compiler will tell you if the code is incorrect, and will usually give you...
  4. Replies
    4
    Views
    648

    Re: Newbie Question, help please!

    Is making a GUI a requirement? This would be much easier if you didn't make a GUI, and ran it from console.
  5. Re: given a startPoint, range and bearing, can I calculate the other point?

    I suspect that the problem is you're using degrees as your unit of angle, which is not what the cos function is intended for.

    http://www.cplusplus.com/reference/clibrary/cmath/cos/
  6. Replies
    9
    Views
    4,216

    Re: vector vs. deque

    There are many different containers to choose from; each is implemented differently, with different relative strengths. Ultimately, it's up to you to choose the best one for your purposes based on...
  7. Replies
    2
    Views
    665

    Re: some questions regarding header guards

    The first method is not standard and will not work with all compilers; furthermore, when a pre-processor encounters a #pragma directive it does not understand, it is (usually) silently ignored, so...
  8. Re: problem using vector for file directory

    Are you getting any compiler errors? The open function of an ifstream object takes a char* and you are feeding it a std::string. If I try that, the compiler objects.

    Also, double check whether or...
  9. Re: problem using vector for file directory

    As an aside to your primary question, that call to main() at the end of your function void list(vector<string>files) - what is that for? Why are you calling main from within a function?

    I think we...
  10. Replies
    7
    Views
    889

    Re: a simple basic question...

    Tat vaL is like rite woteva, ya now? its like wot was in dat like space wen u md yr like a
  11. Re: why should I use exception handling in my code?

    They are not intended to be a replacement for returning values from functions.
  12. Thread: c++ vs VC++

    by Moschops
    Replies
    5
    Views
    928

    Re: c++ vs VC++

    VC++ is a set of applications to write, compile and link C++ code.
  13. Replies
    11
    Views
    1,309

    Re: Strange segfault on linux only

    I haven't definitely seen a compiler bug for a decade. It would have been 2001, using the compiler that came with VS6.
  14. Replies
    9
    Views
    1,359

    Re: Linking Headers and Source

    There's always the doomsday option for including headers:



    #include "D:\theComplete\directory\structure\SRC\C++\MyProject\srclib\apr\include\apr_pool.h"




    So you're saying that the...
  15. Replies
    4
    Views
    1,336

    Re: handle character at string(c)

    This pseudo-code is the sort of thing that would do the job. It should explain to you a method.




    // Get length of source char array (using strlen).
    // Make target char array of this size...
  16. Replies
    19
    Views
    1,563

    Re: textbook advice please

    I would disagree. I suggest that his job is to teach effectively, not promote book sales. If the best way for him to teach effectively is by having the students read a book, then great. It may well...
  17. Replies
    12
    Views
    1,387

    Re: Optimization suggestions

    Loop unrolling sometimes helps.

    Instead of


    for (int i=0; i<some_val; i++)
    {
    someFunction_involving(array[i]);
    }
  18. Replies
    13
    Views
    15,434

    Re: list all files in a directory c++

    Have you tried typing

    dir c:\Program Files

    on your windows command line? It won't work.

    If you include spaces, you need to wrap it in quotes.

    dir "c:\Program Files"
  19. Replies
    13
    Views
    15,434

    Re: list all files in a directory c++

    How do you know the path is correct? If it cannot find the specified path, that would imply that the path must be incorrect.
  20. Replies
    13
    Views
    15,434

    Re: list all files in a directory c++

    http://en.wikipedia.org/wiki/Dirent.h

    The error you listed above indicates that you have a std::String, and you're trying to feed it to something that expects a const char*. This makes sense, as...
  21. Replies
    13
    Views
    15,434

    Re: list all files in a directory c++

    What do you mean by "best"? The code you have posted will work on any system that recognises the DIR command in the shell (once you solve that string to char* problem). Which, I think, is windows.
    ...
  22. Replies
    10
    Views
    852

    Re: Member function not found?

    Whilst this is true, it is not perfect; I know of occasions on at least one IDE when the IDE and the compiler actually had different opinions, so everything looked great in the IDE, but the...
  23. Replies
    10
    Views
    852

    Re: Member function not found?

    If you use the switch -E with g++, you will get out the code immediately after pre-processing, so you can see exactly what code is going to the compiler, and you'll know for sure if the header is...
  24. Replies
    4
    Views
    1,557

    Re: Accessing iterator past the end of a list

    For a long time, the MS compiler that shipped with VS would happily let you do things you shouldn't with off-the-end iterators. As I recall, under the hood, iterators were being implemented to some...
  25. Replies
    1
    Views
    1,245

    Re: undefined reference to `main'

    Your compilation line

    g++ -g -w Test0/memoryleak.cpp -o /home/ramamj/TestObj/memoryleak.o

    doesn't contain your memory.cpp file
Results 1 to 25 of 120
Page 1 of 5 1 2 3 4





Click Here to Expand Forum to Full Width

Featured