Thanks Tonto you cleared all that up for me. How would you have done this if you were given the problem, and why would you do it that way? I am still learning, and I want to know the right way to...
Type: Posts; User: Non@pp
Thanks Tonto you cleared all that up for me. How would you have done this if you were given the problem, and why would you do it that way? I am still learning, and I want to know the right way to...
Okay I fixed the remove method to look like this
char* remove(char *str, char c)
{
char *space = new char[strlen(str) + 1];
char *str2= space;
while(*str != '\0')
{
No I am supposed to return another string that contains the proper output. The original string should remain unchanged.
When I return my new string I am getting a trash value that is not useful.
There are some constraints that I can not remove on the code. The pointers can not be removed.
I am trying to make a function that takes a string and removes all occurences of a specified character then returns the new string. The code I wrote generates an error, and I am having no luck...
But references can only have one alias right? Meaning after they become referenced to another object they cannot be referenced to another object. I think pointers don't have this limitation. Let...
Well I already know that pass by value isn't good except for when I am passing small variables around that I don't want the called function to change. I am only curious of the performance...
Could someone please help me better understand inheritance in c++. I would like to know the differences between public, protected, and private inheritance. Also, I would like to better understand...
If I am passing a large vector structure that contains classes that I created, then which way of passing parameters would I use? I am guessing it doesn't matter. Would accessing elements of the...
What is the difference between these two alternatives? Are there performance tradeoffs? Any help appreciated. Examples below.
//Pass by pointer
void negate(int * pn)
{
*n=-*n;
}