0

what is wrong with my c program

hello, this program compiles but at the execution something is wrong when I use quotation marks to replace apostrophes it works properly can someone explain why this issue? #include <stdio.h> int main() { int i=5,j=3,k; i++; j+=i; k=++j; printf('i= %d;j= %d;k= %d',i,j,k); return 0; }

6th Feb 2019, 1:54 PM
ERRAZGOUNI SAAD
ERRAZGOUNI SAAD - avatar
4 Respuestas
+ 1
You can use single quote only for declare literal chars (eg a single char) while yoi have to use double quote for declare literal strings... Ex: 'c' is different from "c". The first is a character the second is a string builded up by character c followed by implicit null character '\0'. You cannot declare a string using single-quote char but only a single char
6th Feb 2019, 2:01 PM
KrOW
KrOW - avatar
+ 2
Thanks both i thought it was like python they were the same in like such case, ramphy aquino nova i knew what was wrong i just didn't know why
6th Feb 2019, 2:09 PM
ERRAZGOUNI SAAD
ERRAZGOUNI SAAD - avatar
+ 1
#include <stdio.h> int main() { int i=5,j=3,k; i++; j+=i; k=++j; printf("i= %d;j= %d;k= %d",i,j,k); return 0; } this is the problem ---> ''
6th Feb 2019, 2:01 PM
Ramphy Aquino Nova
Ramphy Aquino Nova - avatar
+ 1
C/C++ have more strict rule on this and on other contexts
6th Feb 2019, 2:10 PM
KrOW
KrOW - avatar