Your main function should not take any arguments (except for optional command line args).
Here is the warning I get when I compile that code
[Warning] second argument of 'int main(int, int)' should be 'char **'
What's happening is that "b" is uninitialized, so result will be undefined too. "a" happens to be defined because of how argc is an int in int main(int argc, char* argv[])
The compiler thinks that you're defining your main function as int main(int argc, char* argv[]). The first argument is okay because argc is an int will always be at least 1, second argument is undefined (at first) because you're trying to define it as an int when it wants a char**.
Thankz ganado.. That helped alot. I thot main can do the same function as the other called function. I was unaware of main(int argc, char* argv[]) though i dint understand it fully i got the reason why i got the weird answer.. I wil not try that again.. :-D