for running testcases in vim if first copy the test cases in a text file called 'in' and press F6
which runs the code by taking input from the 'in' text file.
i have
map <F6> :w<CR>:!g++ % -g && (ulimit -c unlimited; ./a.out < in) <CR>
in my .vimrc file.
IS IT POSSIBLE TO RUN THE CODE BY TAKING INPUT FROM THE SYSTEM CLIPBOARD ?
In a platform-dependent way, yes. xclip (with some parameter I don't remember) in Linux and pbpaste in Mac OS can output the contents of clipboard. So for example in Mac OS adding 'pbpaste > in;' before ./a.out should do the trick.
thanks. found it ...
You can use this way:
I tried it on Linux and Windows, so it should work.
UPD: local variables and sanitize string
I used this two in vimrc:
Is good to activate warnings with
-Wall
because several warnings are truly errors and may become difficult to find it.