Type: Posts; User: Richard.J
Search took 0.05 seconds.
April 9th, 2015, 01:33 AM
for (int i = h1.size() - 1; i < 0; i--)
is wrong. Your loop is never executed because "i < 0" is false. It should read
for (int i = h1.size() - 1; i >= 0; i--)
March 8th, 2015, 06:40 AM
Inside your add method, you are trying to do
but vec is a std::vector, which doesn't provide a has method.
March 7th, 2015, 12:35 PM
Use 'template' instead of 'Template'. C/C++ is case-sensitive.
January 23rd, 2015, 03:16 AM
What exception do you get?
And why do you use 'new' for the file_mapping and mapped_region?
January 13th, 2015, 08:19 AM
Thanks for correcting me, 2kaud.
I just did a quick google without further reading when I spotted conio.h.
January 13th, 2015, 01:20 AM
for clrscr/gotoxy, you need to
and for this:
file_ptr = fopen ( "C:\dict.anu", "r" );
January 10th, 2015, 10:35 AM
The online documentation of WSAStartup says
"An application must call the WSACleanup function for every successful time the WSAStartup function is called. "...
January 6th, 2015, 03:23 PM
I am not sure if I understand correctly.
Say you have
int *p = new int;
This leaves you with a default initialised array which may contain any value, depending on the compiler, doesn't...
January 6th, 2015, 01:47 PM
not called "value initialisation" as opposed to "default initialisation" which, for POD types, does nothing at all?
December 30th, 2014, 12:51 PM
Since the connect() call is done on the loopback address, the socket may seem to be connected immediately. I guess you would see a different behaviour using two different machines.
I googled this:...
November 27th, 2014, 04:29 AM
Disabling exception handling (if/where possible) may save you another 8-10%.
November 14th, 2014, 01:37 AM
if( (master_socket = socket(AF_INET , SOCK_STREAM , 0)) == 0)
creates a TCP socket, not an UDP one. Later on, you bind that socket to an address and listen on it.
UDP sockets work a...
September 29th, 2014, 01:30 AM
If position is > vector.size(), the vector will throw an out_of_range exception.
August 6th, 2014, 07:12 AM
It looks like your server is only listening on "127.0.0.1". You need to listen on any available address, or at least on a network address reachable from the outside.
This leaves you with a memory leak. The new Worker object is a temporary object you can never delete. Since you are not using it anyway, your method could be defined like this
template<class T> ...
Apart from what OReubens suggested, I recommend not to return a raw pointer to the object, but a smart pointer. This relieves the caller of createObject from the question of the ownership of the...
Is UTILITIES_EXPORT in your program defined correctly?
April 25th, 2014, 01:31 AM
IIRC, something like
printf("%*s", countBackspaces, tmpString );
but shouldn't this be "spaces" or "blanks" instead of backspaces?
April 21st, 2014, 11:46 AM
While your PATH point to D:\mingw32\bin, your shell complains about "/D/mingw64/bin/make.exe", so maybe there is a colon missing after the "D"?
April 17th, 2014, 01:29 PM
In VS2010, it's "Debug - Start without Debugging" or Ctrl + F5.
In other versions, it might be similar.
March 26th, 2014, 09:32 AM
A scalable server, this looks like a task for IO Completion Port. My first thought was about ::select(), but that cannot handle a large number of sockets, IIUC.
January 10th, 2014, 12:32 PM
Did you run the program in the debugger? That should be pretty straight forward and show you what's going on.
October 17th, 2013, 01:48 PM
Well, it tells you what's wrong:
"error: directory name must immediately follow -I"
This means that in your line
g77-3.3 -I ./src/src_common_depend/
there is one blank too much: between the I and...
Yes, that's what I was thinking of, but didn't want to post because it is so simple.
First of all, please use code tags when posting source code.
Then, never place a "using" directive in a header file. For a discussion, see this link:...
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.