Forum: C++ Feb 17th, 2009 |
| Replies: 7 Views: 473 I'll tell you how to get the strReverse() done. Since this is a home assignment I'll only tell you how you could do it.
First of all you need to decide whether you want to do it the string or char... |
Forum: C++ Feb 17th, 2009 |
| Replies: 7 Views: 473 Public is missing a colon, and get() method should look like this:
long get () const { return x; }
Why do you need set method to be const anyway? |
Forum: C++ Jan 30th, 2009 |
| Replies: 2 Views: 745 You can do this by passing a pointer to char or a string.
#include <string>
void yourFunction(const char * filename); //we don't want to modify so it's const
void yourFunction(string filename); |
Forum: C++ Jan 30th, 2009 |
| Replies: 3 Views: 263 You might want to try something like this, but yes it uses more CPU and memory.
#define YOUR_ARRAY_SIZE 256
#include <string.h>
char * getName(){
char buf[YOUR_ARRAY_SIZE];
... |