Visual Studio causing problems in c++ code

I know it might be awkward to ask this type of question but really this bug is causing a lot of problem for me. I used the cpp mathematical parsing code from this link.C++ Implementation of Basic Expression Parser
http://www.technical-recipes.com/2011/a-mathematical-expression-parser-in-java-and-cpp/

Now I first compiled the code in Dev c++ . It compiled perfectly and I got the desired output
But when I created a visual c++ win32 console application and used the above code and I got the following errors

I got around 9 errors. I know that there might be some library issues that visual studio uses.
I am making a mathematical expression parsing app in windows. There somewhere it uses the snprintf() function which no longer exists in visual studio c library. Infact we have a _snprintf() function which doesn’t provide the required functionality that I need and the app crashes in output.c file.

So how can we resolve this issue such that I can use the the snprintf()
function in visual studio and how can we run the above code present in
the link in win32 console app in Visual studio. I used visual studio
2012 and 2013. There are some more issues like arc4random doesn’t work and we have to use rand and srand functions.

Searched a lot but unable to find the solution. Is it possible to
change the compiler of my visual studio to C99 library where all these
functions exist?
Any help will be highly appreciated. Thanks

The errors on the screenshot seem rather straightforward: the compiler doesn’t allow those types conversion.

It may have worked with another compiler, because compilers have some minor differences, but in general relying on compiler’s quirks is a poor development practice.

What’s the exact code that is giving you trouble? The post you linked too is really long, and at least the first half is Java, not C++.

@Fradow just scroll below and search for C++ Implementation of Basic Expression Parser
You will find the code.
But the point of concern is I want to use the arc4random and snprintf functions in visual studio. Is there a way to change the compiler of visual studio
The only thing I want to know that whether this cpp program will compile in visual studio with any alternatives so that It produce the same output?

Ok, indeed not being able to use arc4random and snprintf seems link a problem.

Apparently, changing the compiler is not possible, see http://stackoverflow.com/questions/14958778/i-need-to-change-compiler-on-vs

Possible work-arounds:

  • Use VS for editing, but use another toolchain for compiling (not practical for debugging though)
  • Use replacement for arc4random and snprintf. For arc4random, you can use rand() (don’t forget the seed), and for snprintf, you should peek at String::createWithFormat implementation, which does exactly that.

To use snprintf under Visual Studio you can try this

#ifdef _MSC_VER
#   ifndef snprintf
#       define snprintf _snprintf
#   endif
#endif