Questions tagged as 'stdin'

2
answers

I can not clean the keyboard buffer in C

In my code, I request a series of data from the user using the gets() function. The problem is that at a certain point in the program when requesting a data with gets() it simply jumps to the next request and leaves the variable bl...
asked by 14.07.2016 / 03:01
1
answer

Data entry via std :: getline does not wait for the user to enter the string

I try to make a program in C ++ to store, search and replace student data, but in the case 3 (to replace data) I have problems with data entry type string. Since in the part where the user must enter the data that will replace the old...
asked by 26.11.2017 / 04:17
1
answer

Read a two-dimensional array (matrix) using scanf

I've tried the following code: scanf("%d %d",&N,&M); int matrix[N][M]; for(int i=0;i<N;i++){ for(int j=0;j<M;M++){ scanf("%d",&matrix[i][j]); } } but when executing it does not stop asking for data, the p...
asked by 24.09.2016 / 21:59
0
answers

Help with switch and getopt

I am trying to read the arguments in the main with this code, what I need is that, when the arguments are -v then a = 10 keep this and when they are -g pass flag a true , but when I run it with -g send me "file: unkno...
asked by 20.11.2016 / 08:59
1
answer

Could someone help me with this program in nasm?

When I try to read from the keyboard a number of 2 digits and then try to print that number again on the screen it does not return the same value, but if I define the number myself if it works, what am I doing wrong? segment .data segment .bss...
asked by 29.05.2018 / 12:57
1
answer

Enter characters continuously in the terminal without pressing Enter

I would like to create a program that would read characters entered by the user but continuously, without having to press Enter every time I type one and stop reading, for example, when entering a '.' Something like: palabra = [] while T...
asked by 15.04.2018 / 21:49