How to provide several examples of working function? [closed] - c++

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
Assume I have a function:
void isUniqueSymbols(string stream)
How to understand that I should provide several examples of how my function works?
I can write something like this:
Input: isUniqueSymbols("abcde");
Output: true;
Input: isUniqueSymbols("abcdee");
Output: false;
But not sure this is correct.
How would you provide examples of working function?

One possibility would be the embed the documentation into code:
assert(isUniqueSymbols("abcde"));
assert(!isUniqueSymbols("abcdee"));
This is pretty close to unit testing/viewing unit tests as documentation, for whatever that may be worth.

Related

I need help writing a C++ program that takes two arguments for two functions? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
My C++ program needs to take in two arguments text or calc, those are the two functions,
How do I set this up to read in 2 input files using a map?
You need to pass command line arguments. You can find plenty or resources online. Here are a couple of examples: http://www.cplusplus.com/forum/articles/13355/ and http://msdn.microsoft.com/en-us/library/17w5ykft.aspx.

Call a function from a prototype in C++ [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
How to call a function from a prototype in c++?
Any suggestions?
see example ...
http://msdn.microsoft.com/en-us/library/a5s9345t(v=vs.80).aspx
I would rather suggest you to get an introductory C++ book from this list and read it properly :
The Definitive C++ Book Guide and List
Then you'll know what you're asking. You need to study a book first, before asking such questions!

Multiple inheritance in C++ [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 12 years ago.
As you know, C++ allows multiple inheritance. But, would it be a good programming approach to use multiple inheritance or it should be avoided?
Thanks.
In general, it's not needed and can make your code more complex.
But there are cases where it's useful. As long as it's useful and isn't causing your code to become unmanageable, I see no reason to avoid it.

Why is C faster than C++ in code execution? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 12 years ago.
Before I knew that C was faster than C++ I was able to write some simple code where C executed faster than C++'s speed.
So my question is: please explain then reason behind this.
If this has already been explained elsewhere on this site or the internet, please share a link.
The reason behind this is your poor test.
C is not faster than C++ because C++
is a superset of C.
Here it is!

remote_api in google app engine is the best way to store data? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
i don't know what the remote_api will do
thanks
You can read about remote_api here: http://code.google.com/appengine/articles/remote_api.html
At a high level, it allows you to write code which interacts with your appengine application code and datastore without having to go through the request/response model.