ALT__'s blog

By ALT__, history, 3 years ago, In English

Sorry if this is not the right place to post this but I tried lots of different thing but just couldn't get it to work. I can write a normal code and compile it with no input. But it just doesn't work with inputs, I tried bunch of different build system but nothing worked. How do I fix this? Or if you don't use sublime, then what do you use on mac? thanks.

  • Vote: I like it
  • +1
  • Vote: I do not like it

| Write comment?
»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

If you are using C++

this build system works for me https://ideone.com/wgbhAX

for input & output: I use an input and output files and I add this piece of code in the beginning of my main function

#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
  • »
    »
    3 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    thanks brother it worked for me just fine build system and everything but by default m1 Macs uses clang gcc and g++ compilers does it cause any problem in long run?

    • »
      »
      »
      3 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      It does cause problems, eg. When you're using policy based data structures like order statistics trees etc.

      Try brew install gcc

»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

This plugin works for me.