Advertisement
teknoraver

qrc.c

Mar 10th, 2015
359
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.43 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <errno.h>
  3. #include <qrencode.h>
  4.  
  5. /* gcc -O2 qrc.c -o qrc -lqrencode */
  6. int main(int argc, char *argv[])
  7. {
  8.     int i, j;
  9.     if(argc < 2)
  10.         return 0;
  11.     QRcode *qrcode = QRcode_encodeString8bit(argv[1], 0, QR_ECLEVEL_L);
  12.     for(i = 0; i < qrcode->width; i++) {
  13.         for(j = 0; j < qrcode->width; j++)
  14.             printf("%s", qrcode->data[i * qrcode->width + j] & 1 ? "▒▒" : "  ");
  15.         printf("\n");
  16.     }
  17.  
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement