nbaztec, this is the C forum. C++ does not work here. ;)
> I want a function which can return a string and also it should be able to take DEFAULT string arguments....
C does not support either default arguments or function overloading, so the simple answer is you cannot do it. The not so simple answer is you can probably do it with compiler extensions and/or tricks, but the end result is probably not worth the extra effort and complexity. You can read more on Stack Overflow.
> This thread can(should) be moved right?
Why? It is not confirmed that the OP even *wants* C++, and errors in compiling your sample code strongly suggests that he is trying to compile as C. Ed is not convinced that "use C++" is the right answer to the question here.
> Well the OP wants default arguments, which he can't get in C
It is not always practical to switch programming languages, even when the languages are highly compatible like C and C++. The OP is using C for a reason, and we should not dismiss his choice so readily. ;)
> you know of any work-abouts?
Yes. Ed posted a link with ideas on how to get default arguments in C.
Hey, so I wanna ask how I need to create a method who will remove word if in that word is 2 same chars. Example: "Potato" in this word there is a 2 "o" chars so this word will need to be removed. "Forum" in this word there is no ...
Hi I'm having a problem implementing a mini shopping cart drop down in the header to show the user all the products they have in their shopping cart. It seems the only solution for this is Ajax, and I've looked all over and can't find anything that I could possibly ...
I am writing a java program that needs to execute shell commands, so I wrote a function that would take the command to execute as a string (ie: "mkdir ~/Folder1") and execute that command with the shell. Here is the function:
Runtime run = Runtime.getRuntime();
Process pr = ...