Most voted "c" questions
C is a general-purpose computer programming language used for operating systems, games, and other high-performance jobs and is clearly distinct from C++. It was developed in 1972 by Dennis Ritchie for use with the UNIX operating system.
Learn more…4,811 questions
Sort by count of
-
-2
votes1
answer281
viewsLimit number of digits in data entry
I’m having a hard time understanding the issue of limiting characters, I researched, but I didn’t understand very well how to use in the code, I made the sketch here, to understand more or less what…
-
-2
votes3
answers611
viewsCode does not run in C on Vscode
I followed 2 tutorials, installed the Vscode and the compiler Mingw, put all necessary extensions, C/C++ Compiler run, among others. And I put the Mingw path in the PATH of the environment…
-
-2
votes1
answer54
views -
-2
votes1
answer64
viewsDouble chained list in C using remove function
Could someone help me because I’m not getting the function of remove, I did everything right, but I’m not succeeding, need not give me the code, just could guide me what is wrong and how to solve. I…
-
-2
votes1
answer68
viewsError in a matrix character counter
I need to do a counter of occurrences of a matrix, by Visual Studio, and I’m doing well, but when I try to run the program, an error occurs and I do not know how to solve. The error that occurs is…
casked 4 years, 4 months ago OlaTudoBemComVoce 1 -
-2
votes1
answer36
viewsSegmentation Fault when running pop command on dynamic stack
I’m trying to implement a dynamic stack but the program ends in error when executing the pop(pop) pop function, returning a Segmentation Fault. I can’t understand why.. I appreciate the help.…
-
-2
votes1
answer3700
viewsProgram C calculating ages based on date of birth
I’m trying to solve this problem... Write a program in C language that uses a structure of the type record (struct) to store the data of 20 people. The registration are: name; day of birth; month of…
-
-2
votes1
answer79
viewsError in Structure Memory Allocation
PROGRAM The program highlights memory as more students or more grades are added, but in certain tests depending on the number of students or grades it takes "dirty" values from memory and plays for…
-
-2
votes1
answer65
viewsHow to calculate a multiplication of matrices with several processes acting simultaneously?
I want to divide the matrix so that each process calculates a slice of matrix multiplication simultaneously. At the moment my code does the multiplication, but the processes are not working at the…
casked 4 years, 2 months ago user206857 1 -
-2
votes1
answer36
viewsConcatenate string into C
Good afternoon guys, I’m starting my studies in c and I found a problem trying to concatenate strings. #include <stdio.h> #include <stdlib.h> #include <string.h> int main () { char…
-
-2
votes1
answer30
viewsHow to access the value of a pointer within a function in main?
#include <stdio.h> #include <stdlib.h> int *Notas_Baixas(float Vet[],int Total_De_Notas, int *Pont_Numero_De_Notas_Baixas){ int i; *Pont_Numero_De_Notas_Baixas = 0; for(i = 0; i <…
-
-2
votes2
answers556
viewsReceive multiple strings in the same row in C
I have the following code that gets the keyboard input and prints on the screen what was typed. #include <stdio.h> #include <stdlib.h> #include <string.h> int main(void) { char…
-
-2
votes1
answer117
viewsHow to make Fibonacci sequence through matrix?
I’m developing a C algorithm that displays a Fibonacci sequence on the screen, but first I built a spreadsheet in Excel to understand how this sequence works and realized that it is a 3 column…
-
-2
votes1
answer73
viewsI can’t find the problem in the code
I made a code in C that when running presents some errors and possibly not a logic error, since when I run it presents some errors, however when I ask a friend to run the code works normally. The…
-
-2
votes2
answers185
viewsFraction Sum Program (Class Overload)
Good evening, I have a question in my program of sum of two fractions using overload of classes, in which the program it is always printing the same value, even modifying the parameters of the two…
-
-2
votes1
answer44
viewsExchange vowels for "*"
I’m making a program to replace the vowels of a typed phrase with * and show to user: #include<stdio.h> #include<string.h> #define TAM 50 int main(){ char f[TAM]; int t_f,n;…
-
-2
votes1
answer37
viewsC arrays problem
Good afternoon, basically I am trying to make a program that will ask the user to enter 10 numbers between 1 and 100 and with a menu in which the menu will have 5 options at this time I am in option…
-
-2
votes1
answer63
viewsInsert Loop in C
I wish to insert an option for the user to type in how many rounds he wants to play against the cpu in this joquenpo game follows my code below, can any c master help me ? thanks #include…
-
-2
votes2
answers33
viewsCompare Char matrix and vector
How do I make, in C, a code that compares whether the line responses of an array are equal to the line of an array? Follows the question: Follow the code I have: #include <stdio.h> int main()…
-
-2
votes4
answers142
viewsVariable value changes in main function
When I declare a function and put the parameter to receive a variable of the integer type, for example, within the main function when I declare the function int param(int x); and then I call the…
-
-2
votes1
answer35
viewsConst int instead of number in the vector in C
This exercise required to store 4 grades of 4 students and then media put on a vector and present, well, I declared the matrix and instead of typing [4][4] I put two variables const int worth 4, and…
-
-2
votes1
answer48
viewserror when registering a subject on a student’s list
I’m doing a school register where I create a double-chained circular list to insert students, and a simply chained list to insert a student’s discipline. In the part of enrolling student everything…
-
-2
votes1
answer60
viewsC language - Why my char vector is getting NULL in the first position after a scanf of another variable
When executing the code below, choosing the option 2 the name is entered "Teste Nome", the struct pessoas[i].nome gets the value Teste Nome\n\000 shortly after the fgets(). However, after the…
casked 3 years, 9 months ago Satoru Kishi -
-2
votes1
answer255
viewsCalculation of the sum of the elements of a matrix
I have to develop a function in the C language to sum the elements of a square matrix of order n since i < j. I tried to test the function I did, but it gives error in line 15, which says…
-
-2
votes1
answer95
viewsFunction that copies chained list in another chained list (excluding repeated elements) does not work
/* I need to create a function that copies a chained list passed as a parameter to another chained list (except repeated elements, if any). This is my current code #include <stdio.h> #include…
-
-2
votes1
answer52
viewserror out of Bounds in doctor memory
I am having an error out of Bounds on doctor memory, and at the time of printing the files. There is something wrong with this code? #include<stdio.h> #include<stdlib.h> typedef struct{…
-
-2
votes1
answer39
views(Language C) I’m not really able to compare if between two chars
This is the initial menu code of the program: #include<stdlib.h> #include<stdio.h> #include<conio.c> #include<time.h> #include<locale.h> void inicio(); void logar();…
-
-2
votes1
answer46
viewsRecursive call that returns the beginning and end of a vector
Good afternoon! I’m very lost in this matter of a college job because I didn’t understand right recursion. Could someone help me? I need it here: A function that returns the index in which the…
-
-2
votes1
answer65
viewsWhy doesn’t my summation work?
I have this activity: Write a function that receives, as input, a vector of n > 0 elements of type Cell and return, as output, the sum, of the weights of all vector elements belonging to bands.…
-
-2
votes1
answer39
viewsHow to read each char of a string, to know if one is contained in the other, in C?
Good morning, good afternoon, good evening. I’m trying to make a statement from my C programming course that asks me to make a code that checks if a string2 is contained in a string1, using pointer…
-
-2
votes3
answers405
viewsMake a program that reads an integer N and then print the N first odd natural numbers
#include<stdio.h> #include<locale.h> int main(){ setlocale(LC_ALL,"portuguese"); int n,imp; printf("Digite um número:\n"); scanf("%d",&n); if(n!=0){//para Zero n ser considerado par…
-
-2
votes1
answer26
viewsThe program just gives me back the list again, without me being able to enter the values, what am I doing wrong?
#include <stdio.h> main() { float saldo, valor; int opc; printf("Entre com o saldo inicial da conta: "); scanf("%f", &saldo); while (opc != 4) { printf("\nBem vindo ao banco.\n");…
-
-2
votes1
answer245
views4x4 matrix in C language
Objective: To sum two 4x4 integer matrices with the prototype below, predefined by the exercise. Prototype to be used: void calc_soma(int* mat_A, int* mat_B, int* mat_C); The prototype was made as…
-
-2
votes1
answer56
viewsInitial problem in C
I’m having trouble with code output, I come from Python and I’m a little lost in the C language, what happens is this: I run the code but it simply ignores the input of the condition variable, it…
casked 3 years, 6 months ago Pedro Linhares 42 -
-2
votes1
answer32
viewsProblem with simple circular list in C
I’m trying to make a circular list but whenever I compile this giving error. Could point me the error? #include <stdio.h> #include <stdlib.h> typedef struct lista { int info; struct…
casked 3 years, 6 months ago Guilherme Barbosa 11 -
-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];…
-
-2
votes2
answers31
viewsProblem in struct
Guys, why is my printf not getting the "time" of the struct? it is showing a random value. Follow the code below: #include <stdio.h> struct cadastro{ char nome[30]; int idade; int ano; int…
casked 3 years, 5 months ago Vinicius Neves 1 -
-2
votes1
answer34
viewsProblems compiling code in C - "[Error]: Id returned 1 Exit status"
Good afternoon guys! How are you? I’m learning codar in C as part of a college course. In the current exercise, we were asked to generate a simple program for inserting/removing records. I relied on…
-
-2
votes1
answer44
viewsDatabase using vector and struct in c
People I need to make a program where I save client data and accounts, I’m trying to save the data of the struct in a vector (it was requested this way) but I’m not getting out of place, I don’t…
-
-2
votes1
answer85
viewsFunction to check palindrome in C
I’m trying to do a function with only these two libraries and without changing the main function check that the word is palindromic. She must have the following exit: radar eh palindromo! rada nao…
casked 3 years, 4 months ago Porfavormeajude 1 -
-2
votes0
answers61
viewsHelp to solve this BUG, I am beginner. C Language
Follow code in full, below. I’m quite beginner yet, so there may be more mistakes. #include <stdio.h> #include <string.h> #include <stdlib.h> #include <locale.h> //Var char…
-
-2
votes1
answer31
viewsBoolean function in C
College exercises. Guys, I decided to make a function so you don’t have to write the same code every time I want to know if the user will continue or not the program. What happens is that it seems…
-
-2
votes1
answer26
viewschar array comparison returns false even for char[] equal - C
I am a beginner in C, I am doing a college activity and trying to compare a data obtained via scanf with a data saved in a registry array that I believe but even entering the same value, always…
-
-2
votes0
answers28
viewsWhy does function removeFirst give Segmentation fault?
//remove da lista a primeira ocorrência do Item i void removeFirst(list* l, Item i){ link cursor = l->first; if (cursor == NULL){ //se a lista for vazia printf("Não há elementos nessa lista"); }…
-
-2
votes1
answer26
viewsHow to store special characters in strings and print to files?
Recently I’ve been working on a C project that involves printing some strings in a txt file. However, when I put special characters and accents are printed some strange symbols, like ‡ and Æ. I made…
-
-2
votes2
answers48
viewsC Language - Read binary file in its full size
I’m developing a software that needs to read a binary file and display its contents. Currently it is displaying the content correctly, but I do not know how to do the loop read the total content…
-
-2
votes1
answer45
viewsCreate a C function, which searches how many times a letter appears in a string
I need to make this function count how many times a letter has been said in the string. However, the result always returns 0. #include <stdio.h> #include <string.h> void contador(char…
-
-2
votes1
answer54
viewsChange in Array Value
I started learning about C, and asking some questions of URI I found a mistake I don’t know how to fix. When entering the values inside the shot array, it inserts all the values correctly, but when…
-
-3
votes2
answers153
viewsreset problem in C code
I would like help with the code I’m having a problem that follows in the image: I’m using this code: #include <stdio.h> #include <stdlib.h> int main () { float CP, LP, PP, LA, AA, AT,…
casked 10 years, 7 months ago matheus ferreira 357 -
-3
votes1
answer1148
viewsHow to select positions of the matrix/ random draw?
Good morning! I need to do a random draw of the elements of the matrix to know if there is a boat (boat=1). As well as, at the end of 10 attempts need to print with (x) the successfully bombed…