I doubt the compiler is smart enouhg to realize str.size() does not change the object. Storing it in a variable first is probably the best bet. Some compilers might have hints in their STL...
Type: Posts; User: orbitz
I doubt the compiler is smart enouhg to realize str.size() does not change the object. Storing it in a variable first is probably the best bet. Some compilers might have hints in their STL...
C has no value which represents a lack of a value. In short, this means that there is no way to check if an object does not have a value because it always does. You might need to rewrite your...
typedef'ing a struct is also fairly useless in C++ as well.
std::string
Go read the section of some FAQ on namespaces.
Why is that a problem in the first place? Sockets are very lightweight in just about any OS, and if you want 1 socket for 2 things then you are not going to be using the same socket to accept still...
Why don't you learn the basics of C++, then the basics of a dozen other languages, and find the one that you enjoy the most. You shouldn't take advice that decides what to do for anything more than...
a[2i] is a syntax error. 2i is a gcc extension for complex number literals. Perhaps you mean a[2*i]. And why you would wan tto do that is qutie confusing.
I don't know what that means.
If you think you learned all about C++ via tutorials in 2 days then yo uare very naive. C++ is a massive language that takes years to become proficient in. And I prefer to be realistic instead of...
Stop using a broken API then.
The documentation states how it gets called. Either as a callback or via a service message.
It looks pretty broken to me.
char *temp = new char;
This allocates 1 char, not 1000000. How do you plan on putting 100000 into room for 1 char?
Not to mention your eof check is wrong. ...
Like any datastructure, it depends on what you want to do. Speed of what?
The idioms of the various languages are fairly different. For some reason I doubt any program around today could produce any code in another language you'd actually want to use.
It depends on who wrote them. With Asynch API's you can write it all in 1 thread. See http://www.twistedmatrix.com/ for an example.
http://threading.2038bug.com/index.html has some good information,...
libcurl has asynch api you can use to avoid threading. Writing a threaded program without understanding the ins-and-outs of concurrency in a non-concurrent orientated language is probably going to...
We aren't your teachers, or mentors, or whatever you think we are. If you can't communicate your question in a post here, or think you are going to have lots of small questions that you don't want...
Please, If you are a beginner at C, then don't attempt to write this. You started out by saying there are no tutorials on building web browsers. This is true because writing a web browser is...
No. and If you consider how often you'll need to be printing pointer values it shoudln't really bother you.
Also, there is no way to recover from an error caused by misuse of a pointer. One would think that would win over even the most fanatical pointer supporter.
I find this argument to be fairly weak, personnely. Anything can be made to be good in the hands of a skilled individual. I think it is probably more important to discuss how much work it takes to...
Although, overloading operator() and using references would allow you to do that without pointers, wouldn't it? But taht certianly is a poor solution IMO.
You seem to be confusing the requirement of pointeres to accomplish things in C++ with pointers being a good thing. Just because C++ lacks decent means of accomplishing the task doesn't mean it's a...
dwks: these 'how fast is x' questions are completley radiculous. Please think about what you are asking. Why the heck does it matter hwo fast 'exit' is? It's exiting yoru dam program, who cares?
...
Making it a compile time parameter seems like a decent enough idea. Let the compiler optimize it. It doesn't appear to really result in nastier code. Look at something like a std::map where you can...