Most voted "scanf" questions
65 questions
Sort by count of
-
0
votes1
answer85
viewsC language - Error when using loop scanf to obtain integer and string type data
At first I was trying to make a binary tree that receives values of the intiro and string type (name and surname). But I’ll just put a bug to fix first. #include<stdio.h>…
-
0
votes1
answer71
views -
-1
votes2
answers159
viewsI can’t keep 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…
-
-1
votes1
answer1260
viewsRead 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 it is not leaving the character…
-
-1
votes3
answers516
viewsVariation of while with scanf
What does this piece of code mean? while(scanf("%d", &variavelA) && variavelA )
-
-1
votes1
answer50
viewsI have a question about this code snippet - Scanf
Hello, would you like a help with this code snippet, could someone explain to me what it does exactly ? (Especially the part %*1[ n]) scanf(%[^\n]%*1[\n], string);
-
-1
votes1
answer19
viewsProblem with character
My teacher introduced me to a method of debugging scanf with characters , but did not give me the explanation of this; What is the meaning of this "%*c"?
scanfasked 5 years, 2 months ago Rodrigo Luiz de Mattos Vergara 1 -
-1
votes1
answer55
viewsError reading string in C
Good afternoon people! In my program I use for reading some strings that fill a struct vector. The first reading usually occurs, but in the second reading the program skips the reading of a string,…
-
-1
votes1
answer48
viewsscanf reading the variable twice!
#include <stdio.h> #include <stdlib.h> /*Faça um programa onde o usuário digita um valor, e imprima na tela todos os valores entre 0 e o valor digitado. */ int…
-
-1
votes1
answer30
viewsSequential reading of data from a file
I have to read a file in which the first line represents the number of registered students and in the following lines occurs the name of the student followed by his grade in the two tests. It seems…
-
-1
votes1
answer57
viewsReceive more than one value per line with C
I need to make a code where it is necessary to receive more than one value per line, however I do not know how many values The initial idea would be to use scanf("%d", valor); However, in that case…
-
-2
votes1
answer385
viewsGet all the text from a typed line
I am creating a C algorithm to train even and need to pick a text (large and with spaces) that the user type at the same prompt. I tried using scanf, gets and fgets and none is picking up what comes…
-
-2
votes2
answers136
viewsScan more than one string
In C I can scan more than one string as is done with integers? Type: scanf("%s %s", pal1, pal2);
-
-2
votes2
answers68
viewsScanf does not work even forcing to ignore the spaces
I’m trying to make a simple program to start messing with C. #include <stdio.h> #include <stdlib.h> #include <locale.h> int main(void) { char nome[100]; char dataNascimento[10];…
-
-4
votes1
answer149
viewsCalculate the Timetable in C. Financial year
I started programming recently and I’m having trouble solving this exercise: Write a program that reads the departure time (hours and minutes) of a flight, the travel time and the difference in…