Search:
Type: Posts; User: ninja9578
Search:
Search took 0.14 seconds.
-
You are looking for the index where the string changes from one char to another?
std::string mystring = "ggaagaaag";
size_t index = 0;
char last = '\0';
for(std::string::iterator i =...
-
April 30th, 2013, 03:39 PM
Personally, I see two ways to do this: method overloading, or templates:
class cylinder_calc {
public:
static int get_volume(int r, int h){ ... }
static float get_volume(float r,...
-
April 22nd, 2013, 10:29 AM
try this
enum SELECTION {
ROCK = 1,
SCISSORS = 2,
PAPER = 3,
LIZARD = 4,
SPOCK = 5
};
-
April 18th, 2013, 05:06 PM
If you use -Wall, you should get a warning when losing precision like that.
-
April 8th, 2013, 09:53 AM
There sure is, but it's not pretty.
foobar * myobject = new foobar();
foobar * clone = new foobar(); //allocate the space for it, don't use malloc
memcpy(clone, myobject, sizeof(foobar));
...
-
March 26th, 2013, 01:30 PM
That would be interesting, I'll bet different languages have different extent of where people code, but I'm just curious about C++.
-
March 25th, 2013, 03:31 PM
Darn, I forgot a third category. Hmm, if you do embedded coding, check backend.
-
March 25th, 2013, 02:59 PM
Debating with someone about what the average programmer does for a living. Im sure that it's always been backend code since it's the most complex, with today's climate of cloud computing, and the...
-
March 6th, 2013, 08:32 AM
I agree with authoritybuilder.
:P
Eclipse has a C++ plugin, why not just use that?
-
March 1st, 2013, 09:32 AM
libjpeg-turbo is a branch of libjpeg6 that has dramatically increased performance. It's used by Firefox, Chrome, Fedora...
-
January 18th, 2013, 03:04 PM
I am just looking for advice, what is the simplest 3D physics engine that you have used, that works well?
All I need to be able to represent is a spherical ground (planet), one or more...
-
December 13th, 2012, 09:18 AM
A handy little function:
inline const char * btoa(bool b){
return b ? "true" : "false";
}
inline char btoc(bool b){
return b ? 'T' : 'F';
}
-
December 10th, 2012, 11:22 AM
well, for one, your method declaration expects a void * to be returned and you are returning and HMODULE.
-
November 28th, 2012, 07:20 AM
No, you would need the SMSC to send the messages to your server, you have no control over that. Sorry, you'll have to think of something else, it's not possible to man-in-the-middle a text message.
-
November 22nd, 2012, 02:18 PM
I never ever recommend writing your own file format, put it in text format and use XML, JSON, YAML, INI... These formats exist for a reason :)
-
November 19th, 2012, 03:12 PM
It's not true that Android dev is done in Java. The SDK is java, most apps are written in it, but the system supports libraries that can be written in any language. Games are usually written in C++...
-
November 19th, 2012, 03:10 PM
A problem with your code lies here
g_Data[iter] = (shortBuf[1] << 8) | shortBuf[0];
because shortBuf is an array of chars, the << 8 will move everything past the last bit. << keeps the type what...
-
November 19th, 2012, 03:10 PM
A problem with your code lies here
g_Data[iter] = (shortBuf[1] << 8) | shortBuf[0];
because shortBuf is an array of chars, the << 8 will move everything past the last bit. << keeps the type what...
-
November 12th, 2012, 07:38 AM
Yep, the stack space has to be allocated all at once in the beginning of the scope. I'm very surprised that Visual C still does that though, almost all other C compilers allow you to have C++ style...
-
November 6th, 2012, 07:32 AM
You need to link to the sip library binaries.
g++ -o parser -I/usr/include/sofia-sip-1.12 parser.cpp -lsofia-sip-1.12
-
October 26th, 2012, 01:58 PM
Was the code edited since laserlight's post? Because it looks like it's declared const to me.
-
October 26th, 2012, 10:26 AM
Check out the fscanf function
http://www.cplusplus.com/reference/clibrary/cstdio/fscanf/
-
October 23rd, 2012, 02:28 PM
++it means this:
increment the iterator
return the new location
it++ means this:
copy the iterator
increment the original iterator
return the copy
-
October 22nd, 2012, 03:22 PM
Based on the name of the thread I can tell it likely had something to do with serialization. As always, I would recommend using a standard serialization format like json or xml instead of writing...
-
October 15th, 2012, 03:52 PM
It does nothing. Most likely there to remind the programmer that there is other cases besides the two specified.
|
Click Here to Expand Forum to Full Width
|