0
Can we use scanf and printf instead of cout?
3 Antworten
+ 1
yes, you Can because those there are also in cpp, then printf exist also in java
scanf("%d",&num);
&= using this you pass the address Memory of a variabile, so the function Can insert the blue
printf("num = %d \n string = %s", num, string);
where %d is for int, %c char, %s string, %f float etc
\n = new line
0
sure. But better use scanf_s (if you don't want to use an old compiler)
Best thing is to experiment with cout and printf and see what you like more. They both got it's up and downsides. I prefer cout because it has more readability. But I know others who think printf syntax is better to read.
0
thnx a lot