Questions tagged as 'scanf'

2
answers

I can not save the string

void ex51(char *nome_ficheiro){//escrever e criar um ficheiro novo. char frase[100]; printf("Introduza o texto que quer escrever neste ficheiro:\n"); scanf("%s",frase); FILE *fp=fopen(nome_ficheiro,"w"); if(fp==NULL){ printf("Er...
asked by 27.12.2016 / 15:21
3
answers

variation of while with scanf

Good evening can someone tell me what this code snippet means, since net searching I did not find follows: while(scanf("%d", &variavelA) && variavelA ) Thank you for your attention     
asked by 07.11.2018 / 02:46
1
answer

Reading char and string in c ++

I have to put an integer, a real, a character and a sentence containing spaces up to 100 characters. I tried to make the solution but I can only type the numbers and the character and the string are not coming out. #include<iostream> #in...
asked by 06.09.2018 / 20:14
2
answers

Scan more than one string

In C can I scan more than one string as it does with integers? Type: scanf("%s %s", pal1, pal2);     
asked by 18.09.2017 / 13:27
1
answer

Pick up all text from a typed line

I'm creating an algorithm in C to train myself and I need to get a text (large and with spaces) that the user types at the same prompt. I've tried using scanf, gets and fgets and none is catching what comes after the space, just the text until y...
asked by 03.07.2017 / 21:11