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
-
0
votes1
answer78
viewsChange scenarios with loop
How do I create a loop in Processing that switches between three or more scenarios (summer, winter and autumn) when my object (car) reaches the window edge?
-
0
votes2
answers68
viewsC - Problems with printing
Hello! So, I’m having problems with the variables "day" and "time". Although I make the required selection, the variable is not printed on the screen at the end of the program. I’ve made several…
-
0
votes2
answers427
viewsFree() in struct with char array
I have the struct struct data { int code; char name[50]; char feature[30]; }; typedef struct data Data; and the function: void free_data(Data *data) { if (data != NULL) free(data); } But the free()…
-
0
votes0
answers123
viewsGet values from an audio file
I’m trying to use a c++ library to detect frequencies of a sound. To use it I need to pass a double type vector with the audio samples. I managed to get a vector but for that I had to use android…
-
0
votes1
answer867
viewsUse of arrow keys to generate movement in play
I wanted to know how the developer of the game Snake in C++ merged with C made the snake move from the arrow keys. I think the part where it moves is when it compares tecla=='K' tecla=='H' and so…
-
0
votes1
answer563
viewsHow do I not print repeat numbers?
How do I not print the repeated numbers ? I saw some examples on the internet but they were something very complex in which I didn’t understand anything :x #include <stdio.h> int main (){ int…
-
0
votes2
answers62
viewsIncorrect Printed Form Values
I don’t know where I’m going wrong. #include <stdio.h> int main (){ int i, num, soma, maior, menor; float media; printf ("Informe 10 valores:\n"); for (i=1; i<=10; i++){ scanf ("%d",…
-
0
votes1
answer162
viewsRuntime error in C
Well, it’s compiling everything ok, however, when I print out the elements of the entire tab matrix[8][8], which is a member of the checksum structure, the compiler, in a way is assigning numbers to…
-
0
votes1
answer60
viewsError when passing a structure by reference in C
I’m learning C. However, I had a problem getting through a structure to a function. I cannot understand which is the error. I will be grateful if someone helps me. Me sorry for the bad…
-
0
votes0
answers276
viewsHow to use conium. h in netbeans
I’m doing a c-protection of the Anoi Tower game. I needed to use the library but I’m not getting it every time I try to add error. if anyone can help me.
-
0
votes1
answer113
viewsHow to turn into a tiny value of a struct?
The next function should turn variables into lowercase and then compare them. I’ve tried converting before, but also bugged. Arithmetic use of pointers together with variables of a struct. Pointer…
-
0
votes3
answers809
viewsC program "eating" characters when executed
Next, All Ides I program in C are output with characters less with each iteration. For example, when executing a for, every iteration one or more characters disappear: Note that in both netbeans and…
-
0
votes3
answers236
viewschar print returns random character
I compile the code below without errors. When I insert the word (or phrase desired) the printf returns a random character like 0 � a etc. The program should read a word (or phrase) and the printf…
-
0
votes1
answer30
viewsntddk. h and wdf.h... libraries can tell me their usefulness in this code?
#include <ntddk.h> #include <wdf.h> DRIVER_INITIALIZE DriverEntry; EVT_WDF_DRIVER_DEVICE_ADD KmdfHelloWorldEvtDeviceAdd; NTSTATUS DriverEntry(_In_ PDRIVER_OBJECT…
-
0
votes1
answer527
viewsEliminating spaces in excess of a text
I have the code of a function that should adjust space in the sentence, but it is not working. I’d like to do with input user the same way the function that removes works. Suppose I have the…
-
0
votes1
answer150
viewssprintf does not give the expected result
I have variables of the type Unsigned Long Int and would like to save its value in a string, to perform calculation of checksum and send via serial communication. void Payload(int long unsigned…
-
0
votes1
answer568
viewsI am unable to pass one vector per parameter in C
I am trying to pass a vector per parameter to a function in C, but I am going through difficulties. #include <stdio.h> #include <stdlib.h> #include <math.h> void calculafx( x2,…
-
0
votes1
answer75
viewsError while running C program
I have to create a movie registration program, but when I run the program and it’s wrong and I don’t know why it doesn’t run, can help me? #include <stdio.h> #include <locale.h> #include…
casked 7 years, 5 months ago Igor Souza 11 -
0
votes1
answer171
viewsFunctions with parameters in c language
I need help to solve the following problem: "Write a function that receives an arrangement of whole as parameter and returns the index of the largest element of the arrangement. Ex : int intMax(int…
-
0
votes1
answer89
viewsProblem in C triangle check
The program aims to identify whether a triangle is equilateral, isosceles, or scalene. But there is an error in the isosceles identification line, where if the user puts equal input values on the…
casked 8 years, 1 month ago Matheus C.R 3 -
0
votes2
answers349
viewsDynamic matrix creation that stores broken text
Attempt to create a dynamic matrix using malloc(). I am in doubt if the parameters I send to the different cycles of the function will be right. int size=0,i,j,n=20; char str[]="Ola. Tudo bem?\n Sim…
-
0
votes0
answers132
viewsHow to edit the Full Path property of the file in Visual Studio
I added an existing file to my project. With this, it fixes the Full Path of my file, and I can no longer change. What I need to do is edit this value by using variables such as $(SolutionDir), so…
-
0
votes2
answers119
viewsChained List C does not insert new node
I started making a chained list program, but when I use the print function, it wasn’t printing anything, so I discovered that the LISTA after leaving the function inserts, it again has the value…
-
0
votes2
answers1792
viewsHow to turn this C++ code into C?
#include <bits/stdc++.h> using namespace std; int main() { int n, i, n1, c = 0, c1, c2, max, pos, bar[501], arr[250001], j; cin >> n >> n1; max…
-
0
votes1
answer103
viewsdo I get exited with non-zero status in that pq code?
#include<stdio.h> int main(){ int i,jog,rod,placar[500],ponto=0,p,maxPonto=0,vencedor=0,rodCopia; scanf("%d %d",&jog,&rod); rodCopia = rod; …
-
0
votes1
answer114
viewscompare an entire row of a matrix
What I want to do is simple: I want to compare an array or an entire row of variables of an array in search of certain values in order var[2][]=={1,2,3,4,5} //inteiro. todos de uma vez instead of…
-
0
votes1
answer343
viewsDifficulty updating global variable. c
I am developing the following code and I am using global variables that can be changed in different parts of the code, but when I change for example the state variable in the menu() function its…
-
0
votes0
answers364
viewsFunction that returns number of nodes from a tree that have the two Esq fields and dir different from null
I have a binary search tree in which I created a function that should return the amount of nodes that have both children (different dir and Esq NULL fields), but my function does not give the…
-
0
votes1
answer117
viewsDoubts in code C data structure
Good afternoon, good I’m here to see if anyone knows why my code is printing a junk memory, when run it shows what I want but it prints a junk memory, if anyone knows why thank you #include…
-
0
votes2
answers81
viewsPointer returning memory value
Folks good night, I turn to you to guide me on my problem. Next, I am developing a work for college where I store and display the sorting results of several algorithms, being number of comparisons,…
casked 8 years, 1 month ago Guilherme Barbosa 1 -
0
votes1
answer73
viewsProblem reading binary files!
I am making a method for a C code that adds an addition to the value of all the books recorded in a binary file, however ... when I have more than 2 records, all from, ie the record 3,4.5 ... are…
-
0
votes1
answer64
viewsError when trying to calculate factorial,per passing meter
I am studying functions by passing parameter,the teacher asked to calculate the factorial of a number by passing parameter,the maximum that I got was the code below, yet the code does not execute.…
casked 7 years, 4 months ago rodrigo alves 19 -
0
votes1
answer182
viewsCodeblocks compile error - Libboost
I am compiling here in Codeblocks, already a week that I am trying to compile, but always some error, and now that is at the end of the compilation is giving some errors and I am not able to solve…
-
0
votes1
answer351
viewsHow to install LLVM?
How to install the Clang/LLVM in windows to run C programs in bash always appears "failed to find msbuilt toolsets" when installing llvm??
-
0
votes1
answer198
viewsError loading file to chained list
This code carries elements from a file. txt, but apparently it can load the file information, but it gives some error in inserting the list, but I’m not able to identify. Follow the code and file…
-
0
votes2
answers190
viewsRead an integer value from a file
I am reading a file with the following lines: ADD 50 ADD 30 ADD 10 ADD 12 And I wanted to read only the integer values for a vector. I’m using this code: while(EOF) {…
casked 7 years, 3 months ago Tiago Esteves 1 -
0
votes1
answer47
viewsWhen copying the code it gives an error using the WHILE function in C
#include <stdio.h> #include <string.h> int main() { int num_key=666; do { puts("\n\n\t*********************************************"); puts("\t* *"); puts("\t* Calculador de temperatura…
-
0
votes1
answer63
viewsWhy can’t I change a variable in C by performing an arithmetic operation with it?
I’m not getting the expected result: libraries ... int main (void){ float c,r; setlocale(LC_ALL,""); printf("Digite o salário\n"); scanf("%f",&c); printf("Digite o reajuste percentual:\n");…
-
0
votes0
answers64
viewsCreate application to communicate with SYSFAN motherboard output
Hi, I’m in need of a library idea, language, code, that you know where I can write the code to communicate with the Fan output from the motherboard. To better understand the idea, there are…
-
0
votes3
answers16701
viewsThe ' ' (SPACE) character, counts in the string in the C language?
For example, it will only save the first letters before the space array, why ? Does anyone know how to explain ? #include <stdio.h> int main(void){ char nome[20]; printf("Digite seu nome: ");…
-
0
votes1
answer191
viewspassword confirmation in c
I need to register N people in my program with only two information: name and password. Then the user enters a name, if this name is not registered the program displays a message of no registration…
-
0
votes0
answers267
viewsPass struct type vector as parameter of a function in C
I need to create a function that is in a file. h that generates random numbers n (defined by the user and passed by parameter in the function), and populate set b with the generated values.…
-
0
votes1
answer82
views -
0
votes1
answer14069
viewsHow can you count repeated numbers in a vector?
I’m wondering if there are how many repeated values in the vector. Here’s the code I tried, but I didn’t succeed. #include <stdio.h> int main(int argc, char** argv) { int a, i, j, c = 0;…
-
0
votes1
answer3508
viewsHow to work with C Dates?
Speak up your people! I took a question here on the internet to do that nothing comes out at all. He asks the following: Want to make a program that reads the name of the book that will be borrowed,…
-
0
votes2
answers1078
viewsHow to count specific characters
I’m making a program that counts how many vowels there are in the word, I managed to do, now I was trying to make only count a vowel in the word, for example Raphael, the appears 2 times, I want to…
casked 7 years, 2 months ago rafael marques 939 -
0
votes2
answers70
viewsConditional operator ?: not working
I’m having trouble using the ?: #include <stdio.h> int main() { int num1 = 10; int num2 = 20; int resposta; num1 < num2 ? printf("sim\n") : printf("nao\n"); // O erro acontece aqui ao…
-
0
votes1
answer137
viewsimport and export file . txt FILE in C
The algorithm should read from 1000 to 15000 ( 1 thousand to 15 thousand) real numbers, sum all and carry out a average, I made several import processes, and final result export, but none copied.…
-
0
votes1
answer619
viewsPrint matrix elements in C++
I’m trying to print the elements of the fruit matrix inside a for, but the code is not working. Where I am missing? int main() { char frutas[20][4] = { "Açaí", "Acerola", "Abacate", "Abacaxi",…
casked 7 years, 2 months ago Kelly Soares 1,181 -
0
votes1
answer419
viewsDoubt with Scientific Notation
There is another way but with %E in c, why I did so and Uri gave 10 % error. Question link My code. #include <stdio.h> int main(int argc, char** argv) { double teste; scanf("%lf", &teste);…
casked 7 years, 2 months ago rafael marques 939