Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to write a "dummy" (do nothing) line in C

Tags:

c

objective-c

Is there a dedicated way to write a dummy line in C? (kind of like pass in Python) If you are wondering why I don't just leave a blank line, I need something that I can attach an Xcode breakpoint to-- if there is nothing there the breakpoint will skip to the next line!! So far I've been using sleep(0) for this purpose. I was wondering if there was a better/more efficient/more official way to accomplish this.

Oh, and I'm using Objective-C, so if there is anything that was added in Obj-C that fits this purpose, feel free to include it.

like image 440
PopKernel Avatar asked Mar 08 '14 02:03

PopKernel


2 Answers

Put a semi colon. It works in C and Obj-C (and Java, and Swift, and many other languages).

;
like image 108
Enrico Susatyo Avatar answered Oct 21 '22 17:10

Enrico Susatyo


Add a trivial assignment

var = var;
like image 39
Merlevede Avatar answered Oct 21 '22 18:10

Merlevede