tags:

views:

127

answers:

3

When writing ruby code, it is easy to test how different functions behave by testing them out in irb. But to test code in C, I usually have to open up a separate IDE and write code there to test how it works. Is there an interpreter-like tool available in Unix or Windows platform?

A: 

I think Ch is the closest you'll get to a C/C++ REPL. I believe it supports all features of C and some of C++.

igowen
+1  A: 

C is not an interpreted language. However, there are a couple interpreters. I think the best one is Ch however it is not open source. CINT is open source:

http://directory.fsf.org/project/CINT/

BobbyShaftoe
+1  A: 

If you just want to test a copy & paste-able bit of code, I often use CodePad to see the results of single functions immediately without compiling. It has its limits, though.

Max