differences between for and while in C

They’re not equivalent. They differ in the use of continue;

If you use continue inside a while it does not increment “i” but if you use it inside a for loop it does increment “i” before going to the next cycle.


#include <stdio.h>
int main(){

int i=0,a=b=2;

     printf("%d ",i);
     if (a==b) continue;
     printf("never here");
 While (i!=3){ // infinite loop
    printf("%d ",i);
    if (a==b) continue;
    printf("never here");


senselock under linux

iker@L450:/etc/udev/rules.d$ dmesg|tail

[ 3991.672990] usb 1-1: new low-speed USB device number 20 using xhci_hcd
[ 3991.864469] usb 1-1: New USB device found, idVendor=0471, idProduct=485e
[ 3991.864472] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 3991.864474] usb 1-1: Product: Elite4 2.x
[ 3991.864475] usb 1-1: Manufacturer: Senselock
[ 3991.864610] usb 1-1: ep 0x81 - rounding interval to 64 microframes, ep desc says 80 microframes
[ 3991.905815] hid-generic 0003:0471:485E.0010: hiddev0,hidraw0: USB HID v1.10 Device [Senselock Elite4 2.x] on usb-0000:00:14.0-1/input0

but hiddev0 needs to have propper permissions.

iker@L450:/etc/udev/rules.d$ cat /etc/group|grep plugdev


iker@L450:/etc/udev/rules.d$ cat 99-senselock.rules

KERNEL=="hiddev*", ATTRS{idVendor}=="0471", MODE="0660", GROUP="plugdev"

iker@L450:/etc/udev/rules.d$ sudo udevadm trigger

PD: I don't like senselock and it is not secure, just annoying. I was asked to use it. Since the device can no longer use new versions of Keil people are using only 8052AH simple mode and the advanced functions senselock once had are unusable so the security it provides actually is silly. I DO NOT recommend Senselock.