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
answer46
viewsParole bugging in C
When I run the program and type the option it doesn’t scan the value given by the user. I don’t know what might be bugging the choice variable this time. What could be? #include <stdio.h>…
casked 10 years, 3 months ago Gabriel Ribeiro 163 -
0
votes0
answers90
viewsDoubt with C pointers
Hello, I am looking for the problem hrs in this excerpt (implementation of an avl tree) but I can not find, I pass a Dictionary D to this function and its value is modified within the context, but…
-
0
votes1
answer325
viewsHow can I access a hard drive sector
I would like to know how I can make a code to manipulate a sector of hard drive and test on it as the Regeneration HDD does for example. And what libraries do I use in C ? (I do not know if in HD is…
casked 9 years, 8 months ago Matheus Chagas 1 -
0
votes2
answers1296
viewsWhat applications for binary trees implemented in vectors?
I know the theory of binary trees, I have already implemented a stroke in C. I understand the functioning and applications of it when developed dynamically. However, a teacher asked me to develop a…
casked 9 years, 8 months ago Douglas Drosdoki 1 -
0
votes0
answers45
viewsProblems with wxWidgets
I am doing a project using wxWidgets, and when the compilation appears the message: error: cannot specify -o with -c, -S or -E with Multiple files. I’m using codeblocks in Ubuntu and I don’t know…
-
0
votes1
answer334
viewsProblems with binary search tree in C
Now reinstating my post more clearly (this is a continuation of my previous question). In the code, I try to create a binary search tree and insert elements into it. They must be saved in .txt.…
-
0
votes1
answer286
viewshow to resolve "SIGSEGV" error when using`strcpy`
Hello, I am facing an error "SIGSEGV": strcpy(buffer_ReceiveAutomation, ls_buffer_PPouAUT); << ERROR and buffer is incomplete from recv, but if I change the sizeof(ls_buffer_PPouAUT) by the…
-
0
votes1
answer397
viewserror: invalid use of Undefined type 'struct Fila'
I’m implementing a queue to control the threads created, in C. So as the thread is not the first in line she waits to be finished. example: // // Enquanto não é primeira da fila // while(idd !=…
-
0
votes1
answer40
views`System.Nullreferenceexception` in C
Running the following code shows the error System.NullReferenceException in function call SubString #include <stdio.h> #include <stdlib.h> #include <string.h> // // Implementado o…
-
0
votes0
answers96
viewsFile encoding error
Hello, I have a file encoding problem with my program that I made in C. It is writing in a format full of special characters which before was not writing this way. The Program is a Numerical Turing…
-
0
votes1
answer1003
viewsHow to create a child process to an existing process in windows - C/C++
I need to call via Createprocess() or another function of windows a process and link to an existing process, it is possible to? thank you!
-
0
votes1
answer371
viewsHow do I read a C sound file?
I want to make a mini sound player using double chained list, and I wanted to know which library and what functions it uses to read a sound file in c ?
-
0
votes0
answers1387
viewsThis program is giving Runtime Error on Uri, I would like to know where I am missing
#include <stdio.h> #include <stdlib.h> #include <math.h> #include <string.h> int main(){ short int numCasos, i = 1, j = 1, soma = 0; long long int num; scanf("%hd",…
-
0
votes1
answer758
viewsChange place characters - C
I need to write a C program that takes a word (string) as a parameter and generates a new string consisting of the original string with the following changes: The first character of the string must…
-
0
votes2
answers99
viewsGeneration of allele numbers
I have declared a method for generating random numbers, but the results are almost always the same, because? int geraAleatorio(int min, int max) { return ((rand() % (max - min)) + min) + 1; } Is…
-
0
votes2
answers66
viewsList removal
I have a program that registers trucks, cargo and cities through a list. I tried to remove the truck list, but when I removed it, the insertion still continues, as if I hadn’t removed anything. What…
-
0
votes1
answer99
viewspreecher array, struct in C?
how do I fill in leds and seq without needing a loop for? int main() { struct ledvalue { int seq[10]; int leds[10]; }; struct ledvalue numbers; numbers.seq={0,1,2,3,4,5,6,7,8,9};…
-
0
votes1
answer136
viewsHow not to show in the output the null positions of a vector?
How do I prevent those gigantic numbers referring to the empty positions of my vector from appearing? My code: int main(int argc, char** argv) { double notas[10]; double soma = 0, media = 0; int i,…
-
0
votes1
answer87
viewsRead a specific phrase from a file and stop at it
I want to store in a string a part of an archive: Bruno Mossa Rezende 5 2 7 6 22 22 0.13 8 19 141 0.17 260 2 320 5.42 43 22 6 0.90 0 0 0 5 of that file I want to store in a string "Bruno Mossa…
-
0
votes1
answer108
viewsTwo readers on the Australian
how this code in I read the card and inform if it is registered or not. Now I need to insert two rfid readers in the Arduino. How to add the second rfid reader to this code? include SPI.h include…
-
0
votes0
answers53
viewsDoubt when using variables
#include <stdio.h> main() { float valor; printf("..."); scanf("%f", &valor); printf("%0.2f", valor); } In scanf I must refer to the pointer (memory space), already in printf this reference…
casked 9 years, 6 months ago Fábio Jânio 3,407 -
0
votes1
answer65
viewsCreate dynamic structures from a text file?
I have data stored in a text file. I want to read the text file and store the data in my variables, then insert them in my function inserir_medico that will use the data to create a concatenated…
-
0
votes1
answer56
viewsSIGSEGV error in using a pointer
I have the following problem: I am creating a pointer and allocating memory in it, passing its reference to function, but when I read it in the function happens the error reported in the title.…
-
0
votes2
answers112
viewsWhat’s wrong with my Quicksort code in C?
Here is my code: #include <stdio.h> #include <stdlib.h> int lista[1000]; int tamanho; main () { printf("Tamanho: "); scanf("%d", & tamanho); int c; for (c = 0; c < tamanho; c++) {…
-
0
votes0
answers55
viewsOffset vector hash error
I am trying to hash vectors with displacement for collision treatment. My program is giving an error. Someone can help me find the reason for the mistake? Follows the code: #include <stdio.h>…
casked 10 years ago Israel Jesus Filho 1 -
0
votes1
answer98
viewsrow on c doubt
having the code of the queue need to remove value and position both chosen by the user typedef struct reg { int conteudo; struct reg *prox; } celula; // Tira um elemento da fila fi e devolve // o…
casked 10 years ago Matheus Matheus 11 -
0
votes1
answer3668
viewsHow do I use fgets instead of gets?
before "talking" about my problem, first look at my code and ignore the accent errors in the console if you are going to run. #include <stdio.h> #include <stdlib.h> #include…
-
0
votes1
answer241
viewsI can’t compare char[]
I am running a server that I did in C and is working normally, with only one exception: I cannot create a condition for the received bytes. The Write and Recv function work normally but I am falling…
-
0
votes2
answers73
viewsStack does not remove values
Hello, I am making a Stack (LIFO) and it does not replace the values by 0 when removing the values from the stack. This was a way I found to "remove" the data from it and the display is shown with…
casked 10 years ago Giovanni Cruz 81 -
0
votes1
answer1075
viewsInsert Row C element
How do I "Insert an element (returning 1 if the insertion has been successful, and -1 otherwise) in a Queue" I did it, what’s missing: void enfilerar(tipo_fila *fila, int valor) { if…
-
0
votes1
answer127
viewsErrors when compiling program using Mysql resources
I’m learning to use the Mysql, but I had some problems compiling a program, in C, using the resources of Mysql. Follows errors below: gcc: error: Usage:: No such file or directory gcc: error:…
-
0
votes1
answer400
viewsFunction First element Stack
How do I make a function that returns the first element inserted of a pile? For example: i add whole values to my size 5 vector stack. 3 4 5 6 7 You have to return the first element inserted in the…
-
0
votes1
answer856
viewsexercise Floating point error
I have a list of floating point errors and am having some difficulty with one of the questions. If anyone can help me, I am grateful. For the code below, I need to justify the reason for the error.…
-
0
votes1
answer64
viewsAt the end of String’s printing always leaves the 0p. What is it?
I made a code to accept only a few characters read in one vector and pass to another vector. In this case, the first user can type whatever he wants and the program keeps only digits, mathematical…
casked 10 years ago Miguel Goffredo 65 -
0
votes1
answer260
viewsHow to read file . cap with C?
I’m making a small program in (C/C++) to read some data from a. CAP file (provided by TCPDUMP). A good example would be Wireshark, but need much less INFO. Turns out, this . CAP seems to be written…
casked 10 years ago Roberval Sena 山本 492 -
0
votes1
answer352
viewsCould you add a parameter in: system("color", var) in the C language?
I’m creating a simple program to change the color of the system. Only, I want to give the option for the user to write the color he wants. Ex: Has the table 1: Blue 2: Green F: Red C: Yellow F being…
-
0
votes1
answer97
viewsConversation error from int to String
This code I’m using to study C, is not converting (at least it’s what I think) a INT temp10 to CHAR... appearing an error: line 5: 5182 Segmentation failure (recorded core image) What can it be? int…
casked 10 years ago Roberval Sena 山本 492 -
0
votes3
answers336
viewsProblem regarding type in function with variable parameters in C
I’m having trouble solving a problem in a function that receives variable parameters. I have a function that sums a variable amount of numbers, its first parameter is the amount of numbers to be…
-
0
votes2
answers895
viewsError in using Else
The program is giving an error when compiling. Else without a Previous if Something about the else, there’s something wrong with the condition if and else? #include <stdio.h> #include…
-
0
votes1
answer127
viewsNumber of elements allocated from a pointer
I need to know how many elements are allocated in my pointer pointer. For example with vector, sizeof(v)/sizeof(v[0]) this way I get the number of elements that this vector has. I would like to do…
-
0
votes2
answers2034
viewsHow do I compare two strings in c
Basically what I want to do. It is receiving a String at the command line.Only the String entered, have to be in the binary base, so I do an if to check whether it is binary or not. My problem is in…
casked 10 years ago Programador 135 -
0
votes1
answer83
viewsFILE function in C
what needs to be done: develop an algorithm where calculates from file input values . txt or values entered by the user, a value in percentage that is outside the allowed, in case +-3 for all cases,…
-
0
votes1
answer160
viewsQuestion about row in C
Can someone analyze my code and see what might be wrong?. It’s a simulation exercise I got to do in college. Error: Code runs, but loops. Which while has a problem? Code: #include <stdio.h>…
-
0
votes2
answers477
views -
0
votes1
answer43
viewsError setsid function relative to ppid
****When running the source below relative to the creation of a Deamon with the setsid function, it was verified that after the ps -fu root command, ppid is not 1, that is the same as the init of…
-
0
votes1
answer613
viewsOperations with linear queues, moving an element to the first row
I need an algorithm that handles a linear list of type FILA. (In PASCAL, it can either be done in pseudo-code, or C, or whatever is preferable). The algorithm must take an element from the queue,…
casked 10 years ago João Regis 336 -
0
votes0
answers53
viewspcap/pcap. h library usage examples for C programming
In the previous post, I wanted to know how to read correctly a HEXA character, (by chance it was from a .PCAP file)... Which has already been resolved! But now, the next step is already another: I…
casked 10 years ago Roberval Sena 山本 492 -
0
votes1
answer111
viewscrt*. or C files
What are the archives for crt1.o,crt0.o,crti.o e crtn.o in a program C. I know the extension .o has to do with object file, but what the cited files serve?
-
0
votes1
answer42
viewsError printing message inside condition
When I type any value other than 2 equal values, the "Invalid typed value!" message is displayed anyway. Anyone knows why? #include <stdio.h> #include <conio.h> int main(){ int x, y;…
-
0
votes2
answers75
viewsQuestions about the standard C library
I noticed that the header file (.h) are different in different compilers. So I have the doubt, is that this "C ANSI pattern" just defined which functions should have the standard library and not…