0

I just want to find some short key for sublime text 4 that maybe not even exist (I tried to find it on google so if he exist sry my bad X:)...

question: sometimes I write program that will be easier to test (if it working correctly) using comments, I mean by that comment everything else what inside the same function without that piece of code that I wanna test.

for ex: (I just wanna run, print hello 3 and hello 4)

#librarys ...

int main(){

//printf("hello 1");

//printf("hello 2");

printf("hello 3");

printf("hello 4");

//printf("hello 5");

return 0; }

(im using c if its relevant) someone knowing some info that could be helpful?

MP3
  • 1
  • 1
  • You could select the whole function, comment that, and then select what you want to uncomment and uncomment that. – PiRocks Dec 31 '21 at 18:34
  • You can use the [preprocessor](https://en.wikipedia.org/wiki/C_preprocessor) for conditional compilation. – Sercan Dec 31 '21 at 18:44
  • @PiRocks yea I probably do something similar to that every time but its not so officiant and sometimes when you uncomment these lines some lines still will be comment – MP3 Dec 31 '21 at 18:57
  • @Sercan ty I will undarstand what u mean by that in next year. – MP3 Dec 31 '21 at 18:59
  • ty guys and happy new year! – MP3 Dec 31 '21 at 19:01
  • Why not just highlight the sections you want to comment and hit `Ctrl-/`? You can have multiple regions selected at the same time... – MattDMo Dec 31 '21 at 20:24
  • hey @MattDMo I personally using : 'Ctrl - shift - /', I think its little bit better for me... sometimes when u want to run specific code u probably dont want to waste your time to find every piece of code that u dont rly need and because of this reason I think its will be very helpful sometimes just to mark and press on specific short key to comment others lines of code in the function. – MP3 Jan 01 '22 at 11:54

0 Answers0