Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
100% Quality Score
Upvotes Received
1
Posts with Upvotes
1
Upvoting Members
1
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
0 Endorsements
Ranked #27.9K
Ranked #3K
~4K People Reached
Favorite Forums

6 Posted Topics

Member Avatar for brynjar

[QUOTE=Chilton;1611677]If you would like to return a newly generated "array" from a function, you can create a pointer to that type and dynamically allocate space for the array, within the grav_force function, set its values, then return its address. ...[/QUOTE] In general, it is bad programming practice to allocate memory …

Member Avatar for lcordero
0
229
Member Avatar for merse

Using a trick I borrowed from [URL="DANIWEB"]http://www.daniweb.com/software-development/cpp/threads/41594[/URL], I did the following: [CODE] #include <iostream> #include <set> using namespace std; template <typename T, int N> char (&array(T(&)[N]))[N]; int init[] = {1, 2, 3, 4, 5, 6, 7, 8, 9 }; set<int> myInts ( init, init + sizeof array ( init ) …

Member Avatar for lcordero
0
2K
Member Avatar for montjoile

The [B](*nodo)[/B] is because malloc() is declared like so: [CODE]extern char * malloc();[/CODE] so you must cast to [B]nodo *[/B] to make the compiler happy.

Member Avatar for montjoile
0
118
Member Avatar for thierrypin

The problem may be related to the [CODE] dact_line.append(buffer); [/CODE] Assuming dact is a std::string, then the buffer will be copied completly until the first NULL terminator. You should only be appending the number of bytes read, not the entire buffer. Use [CODE]string& append ( const char* s, size_t n …

Member Avatar for thierrypin
0
190
Member Avatar for kutuup
Member Avatar for MixedCoder

I've just started playing with boost and have implemented both the async server and client sides. One thing that I see wrong is the declaration of io_service inside of start_accept(). The io_service must exist outside start_accept so that you can eventually call io_service.run() and actually perform the accept().

Member Avatar for lcordero
0
550

The End.