Search results

  1. T

    c++ seg fault:

    std::getline(std::istream&, std::string&) is defined in <string>, there's no need to allocate and manage your own buffer in this case. I'll second the post above in doubting that this is really seg-faulting in getline due to allocation issues, Have you tried stepping through the code with a...
  2. T

    Quick question: C++ compare to null?

    It is near impossible to write exception safe code in c++ without RAII, smart pointers of some type are required to keep from leaking in the face of exceptions without resorting to try/catch at every level. C++0x/tr1 includes support for additional smart pointers based largely on those found in...
  3. T

    Quick question: C++ compare to null?

    In c++, Null is defined to be 0, there is no difference. See Stroustrup
  4. T

    Automated testing in C/C++

    Boost Jam is the toolset that's used to build boost.
  5. T

    Automated testing in C/C++

    I've used Boost Test in the past, it's pretty easy to get started with and does its best to stay out of your way. If you're not already using/familiar with boost, there will be a slight learning curve.
  6. T

    C#, password checking -- would like to use regular expressions library

    Without getting into a debate over the better method... (I don't think performance is a valid argument here in either case) This manual method code is creating multiple string copies each time through the inner loop, try this instead: for (int k = 0; k < s.Length; k++) { digitOK =...
  7. T

    What's the proper way to clean up this type of memory allocation (C++)

    std::auto_ptr<TYPEDEFD_TYPE> pointerToTYPE((TYPEDEFD_TYPE*)::operator new(Multiple * sizeof(TYPEDEFD_TYPE))); use boost::scoped_ptr or boost::shared_ptr if available depending on needs.
  8. T

    arrays of function calls and memory errors

    He's not dereferencing the array, ->* is the pointer to member operator. That said, you should only be calling through to valid function pointers, anything else is undefined and will probably lead to strange runtime behavior.
  9. T

    Stupid C++ question...(should be easy to solve!)

    like this? typedef std::vector<int> IntVec; typedef std::map<MyKey, IntVec> MyMap; MyMap map; IntVec vec1 = ...//create/fill vector map.insert(std::make_pair(someKey, vec1)); ... MyMap::iterator it = map.find(someKey); IntVec& vec2 = it->second; vec2.push_back(newInt);
  10. T

    did visual basic 6 have native code or interpreted compiler

    Who told you that? Native code will be produced by the JIT compiler at run time - this has the advantage that specific optimizations may be done depending on the currently running target as well as hot spots observed in the running code. Also, you can produce completely native code in visual c++...
  11. T

    C++: Do you flowchart?

    I'm of the opinion that it's useless to create any type of documentation unless it's embedded in the source itself. (And even that's of limited value) It may seem like a fine idea when you're first starting a new project, but it'll be worthless when needed the most a couple years down the line...
  12. T

    PHP: how to abort construction of an object?

    throw an exception?
  13. T

    Overloading an STL function

    Especially considering that it's illegal to add anything to the std namespace. Either use a boost ptr_container, or roll your own by layering on top of a standard container.
  14. T

    How to access member of template in C++

    You can't. The value is statically bound at the point of instantiation. If you want a different value used, then instantiate the template with this value.
  15. T

    C/C++ prefix vs postfix increment

    Don't be so quick to brush him off, if the difference were < 100ms, I would agree with you; we're talking over a second here though. (assuming he didn't decide to do anything crazy at the same time as running the test the second time, this gives at least a rough picture of things) Do you have...
  16. T

    C/C++ prefix vs postfix increment

    No, consider the overloaded operators for some class A In order to properly implement a postfix increment for a user defined type, a copy of the object needs to be made and returned back to the caller. As for whether this temporary copy can be optimized out if not used, that's going to...
  17. T

    C/C++ prefix vs postfix increment

    The issue isn't with primative types, there's no reason that the compiler shouldn't generate the most efficient version for primatives if you don't care about the previous value. The issue arises with user defined types with overloaded pre/post increment operators (such as iterators) where the...
  18. T

    Null an object within itself?

    Something like this should accomplish what you want. I haven't done java in a while, so syntax might suck.
  19. T

    Old C++ Book

    std::cout << "not quite" Quite a bit has changed, both in language and standard libraries since then. While the code in the book may still compile(much probably wont), you'd certainly be limiting your exposure to newer features and perhaps pick up poor practices that at one point were...
  20. T

    C++

    For a more c++ish aproach: (Note: like previous solution, this is assuming that you want an array of character values, not actual integers)
  21. T

    JSP/Java: Why doesn't this switch() work?

    java has very rich collections, there's no need to write code like that
  22. T

    Programming Question

    It will return the static constant string::npos (which is the largest possible value of size_type, or -1) It's a matter of style, but I'm on the side of comparing to this constant rather then -1 directly.
  23. T

    Difference between C,C+,C++,C#

    Oh please. You may well have been speaking in generalities, but in a number of cases those generalities were flat out wrong. What's the harm in kamper providing accurate information? Your not doing the op any favors by swaying him away from a set of languages with inaccurate info. (Java / C#...
  24. T

    How can we use subdomain as part of query string?

    You can do it in a .htaccess file as long as the host supports mod_rewrite.
  25. T

    How can we use subdomain as part of query string?

    you can do this with apache's mod_rewrite (assuming apache in use) It basically uses regular expressions to rewrite url accesses. There's a demo similiar to what you want here
  26. T

    Question about malloc/free

    I've got to disagree, it depends entirely on the program. There are many situations where you simply don't care about the memory that's lying around, it's faster to just exit when the user tells you to. This is especially true when the programs been unused for awhile with lots of memory paged...
  27. T

    Question about malloc/free

    yes
  28. T

    PHP - Constants and variables

    function constant does what you want
  29. T

    how to programmatically check version of an exe / dll file?

    I was bored so here's a sample program. See GetFileVersionInfo on MSDN for more info.
  30. T

    Python Question: how to tell if a file is open?

    *I'm not a python programmer* I'd think you should be able to move/rename the file, the operation should fail if another process is writing to it. (in
  31. T

    Adding File Version info to a vc++ program

    All you should need to do is add a new Version Resource to your project and edit appropriately.
  32. T

    Need some Java help

    try something like this. remember, nextToken is a method, you need to include parens. Also, nextToken returns an integer value indicating the token type read, look at the constants that start with TT_ in the class. The actual token read is placed in either sval or nval depending on whether a...
  33. T

    Java question

    No, they will output the same thing. the loop itirator isn't evaluated until after the first pass through the loop. The difference is in expressions: int i = 5; int j = ++i; //i is now 6, j is 6 int i = 5; int j = i++; //i is now 6, j is 5 since i incremented after assignment
  34. T

    Using Data Structures in .NET

    How many records are we talking about here? I get the feeling that this is a standalone single user client app with maybe a couple hundred and certainly less then a couple thousand records. If this is the case, I don't see any reason to care about storing all data in memory, computers aren't...
  35. T

    So, will Quake 4 be on shelves tommorrow?

    Saw it on shelves at best buy today, so chances are good
  36. T

    PHP mail() problems

    Dynamic DNS is free from dyndns, have another look. A service like this is really the way to go. That said, your problem could be your isp blocking any smtp connection attempts to servers other then the ones they run - they do this to slow down spammers. You should be able to use your isps...
  37. T

    RecvFrom call causing unhandled exceptions

    for your new problem, c requires all variables be defined at beginning of block, before any assignments, function calls, etc.. define newItem at begginning of function.
  38. T

    RecvFrom call causing unhandled exceptions

    You sure it's possible to lose previous data on a call to realloc? My understanding was that if there isn't enough free memory, it'll return NULL and leave the original location untouched. This behavior would make the most sense if you think about what realloc actually has to do when...
  39. T

    RecvFrom call causing unhandled exceptions

    Use strcpy
  40. T

    Does a car still burn gas while moving with its own momentum?

    I know for my manual car, while in gear with foot off accelerator, all fuel to engine is cut. Don't think this is the case with automatics, not sure if all manual cars operate like this (assume all fairly recent computer controlled ones would)
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |