Questions tagged as 'printf'

3
answers

Difference between% i and% d

Is there any difference between printf("%d", x); and printf("%i", x); ? I know the two return the same result, does it have some sort of convention adopted to always use %d ?     
asked by 12.09.2016 / 20:41
3
answers

format '% d' expects argument of type 'int', but argument 2 has type 'char *' - What is this? How to pack?

Code: #include <stdio.h> int main(void) { char caractere, *caractere_ptr = &caractere; printf("Caractere: foi alocado %zu byte\n", sizeof(caractere)); printf("Endereço: %d", caractere_ptr); return 0...
asked by 23.01.2017 / 19:09
2
answers

printf in Java - What is% 3d for?

I'm seeing a java arrays exercise, but I can not figure out what the %3d is, if it's a int . for (i=0; i<n; i++) { System.out.printf("a[%d] = %3d b[%d] = %3d\n", i, a[i], i, b[i]); }     
asked by 12.02.2016 / 18:25
3
answers

What are the differences between printf, fprintf, sprintf, snprintf, printf_s and fprintf_s?

Searching I noticed that there are several variations of printf , but I did not understand the differences and which to use in certain circumstances. I would like to know the purpose of each with their differences and how they can be us...
asked by 04.09.2016 / 05:56
2
answers

Puts () and Printf (); when and which one to use?

Data entry requests are usually preceded by a text that indicates what you want to receive and usually do not have data to format; my question is this:   If variable data is not being displayed in the request text, why do books and teachers al...
asked by 18.08.2018 / 01:15
1
answer

How does printf work?

How does the code behind the function printf() of C work? I know what this function does, I want to know how it works.     
asked by 04.08.2015 / 21:51
2
answers

What is sscanf () and sprintf () used for?

What is sscanf() and sprintf() ?     
asked by 13.10.2018 / 22:07
2
answers

Difference from cout to printf in C ++

I want to know what difference I use in C ++ cout and printf , is it all the same?     
asked by 11.05.2017 / 22:59
2
answers

Concatenate text with variable char in printf

I need to concatenate the person's name (variable) with a text. Following logic, it would look like this #include <stdio.h> int main (void){ char nome[6]; printf("Ola! Insira seu nome, por fovor: \n"); scanf("%c", &nome)...
asked by 10.04.2016 / 02:03
3
answers

Program does not meet expected flow reading and printing entry

#include <stdio.h> #include <stdlib.h> int main() { int num1, num2, num3; printf("Digite o numero A e numero B para saber o resto da divisao resultante da divisao entre eles:\n"); printf("NumeroA: "); scanf("%...
asked by 05.11.2017 / 22:50