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
answer51
viewsClassico "Execution of C: . . . failed" in codeblocks
I’m having this problem in codeblocks where when I try to run any program in it I get Execution of 'C: Program Files (x86) Codeblocks/cb_console_runner.exe "C: Users Desktop Client C test.exe…
casked 9 years, 11 months ago Filipi Maciel 395 -
0
votes1
answer70
viewsEditing in Linked Lists
I have a college protégé for a programming chair. One of the objectives is the evaluation of inserted projects (the insertion part I already have working), my problem is that when evaluated, I don’t…
-
0
votes0
answers138
viewsColouring in pascal/C
I have the following coloring code of regions using queue in Pascal: program coloracao; uses crt, filas; const dim = 5; type imagem = array [0...dim+1, 0...dim+1] of integer; const I: imagem = ((-1,…
-
0
votes1
answer29
viewsConversion error in c::b
I have a queue set like this: typedef struct nodo { int inf; struct nodo *next; }NODO; typedef struct { struct nodo *INICIO; struct nodo *FIM; }DESCRITOR; typedef DESCRITOR *FILA_ENC; And a function…
-
0
votes1
answer35
viewsProblem with the final results
Good evening, my code is giving a problem that I can not find, his idea is the following: I add the number of questions and the number of students in the class, and then add a feedback and the…
casked 9 years, 10 months ago Gabriel Vinicius 339 -
0
votes1
answer34
viewsHow do I enter with several different files
Good evening, I have a question, I have a program that will receive several files of the type nome.txt, and I must count how many characters are inside the file, I tried to make a prototype but…
casked 9 years, 10 months ago Gabriel Vinicius 339 -
0
votes1
answer183
viewsDoubt about the use of `for` in voting system
I want to make a program where the user gives the number of candidates and their names, and then the vote is started until the user type order. Help? #include<stdio.h> #include<string.h>…
-
0
votes1
answer98
viewsHow to check the elements close to a specific element in a matrix?
The goal is to try to find on the college campus possible locations for building a new building. The user will enter the matrix representing the college plan. R = Ruas P = Prédios V = Área Verde E =…
-
0
votes2
answers157
viewsProblem in string printing
I would like to know what the problem is with my string inside the function, it goes through the string and when I find an uppercase letter turn it into a lowercase letter (I have tried using the…
casked 9 years, 10 months ago Gabriel Vinicius 95 -
0
votes2
answers192
viewsFile manipulation
Hello. I have a big problem to manipulate and create a C file. First I did the whole code using a struct and functions, everything worked right. I put the commands to create the file and it is also…
-
0
votes2
answers376
viewsHow to include "time" library in the compiler?
I am compiling in C on my Mac by terminal, this all a wonder, the only problem is that when I need to call a new library I don’t know what the command to call it by terminal. Ex: #include…
-
0
votes1
answer206
viewsMultiway Mergesort-External errors in C
I implemented a C code of an External Multiway Mergesort ordering that reads the values in a.txt file, passes these values to the input files and migrates from the input files to the output ones…
casked 9 years, 9 months ago Thiago Mayllart 13 -
0
votes3
answers146
viewsPerfect square, not so perfect
I need to know if the sum of two numbers is a perfect square, I thought of adding the two and take the root and then check if the rest of the division by 1 is greater than zero, only the operator…
-
0
votes1
answer2020
viewsProgram requesting libgcc_s_dw2-1.dll
This mistake is happening: I’m using Code::Blocks, trying to create a program with wxWidgets.…
-
0
votes0
answers231
viewsVariable error in C
Good morning, I am developing a code to realize the solution of a linear system in C using iterative methods (Gauss-Jacobi, Gauss-Seidel), the method of resolution is right, but after the execution…
-
0
votes2
answers594
viewsApplication of Bubble Sort
I am making a program, which prints at the end the numbers typed by the user in ascending order using Bubble Sort. It wanted a help to implement this function. My code: #include <stdio.h>…
-
0
votes1
answer70
viewsDate storage of the system
I need to capture the system date and store it in an entire variable, as I will need to compare it to a date that will be informed by the user. I found the function _strdate that stores the date on…
-
0
votes2
answers166
viewsSeveral errors in code C - How to fix?
#include <stdio.h> #include <math.h> void rebeber_matriz (int l,int c) { int M[l][c]; for (l=0;l<4;l++) { for (c=0;c<4;c++) { printf…
-
0
votes1
answer1507
viewsExecutable created by Codeblocks opens and closes alone
I have a problem with my Codeblocks program. When I compile and run the program, Codeblocks creates a executable in the Debug folder that is inside the bin folder, located in the same folder where…
-
0
votes1
answer94
viewsHow to read a charde a file and convert to whole
The following code snippet should show the entire value of the single character stored in the file. when I put a letter like 'a' for example works. but when I put this symbol: þ. and several others…
-
0
votes2
answers159
viewsJavascript and C language accessing the same database
I’m using a Facebook APP (and Javascript SDK) to use login on a website, in addition I must store some basic information about the user. As required by the teacher, this site was built "using the C…
-
0
votes1
answer42
viewsUse generated data in a function
Hello! The function below aims, whenever called, to allocate a memory space that will serve as a "set" for future uses. These sets must be identified by a number, starting at 0 for the first set and…
-
0
votes1
answer104
views -
0
votes4
answers255
viewsHow to read an input in the loop
I’m a beginner in C. I need the program below to read the number typed in console and give tips to the user until he gets it right: #include <stdio.h> int main () { int num; printf("Informe um…
-
0
votes1
answer253
viewsProblem with Allegro image call by Mac C terminal
Guys have a problem here, I’m playing a game using the Allegro, I am compiling by the terminal and ta ok, there is only one however, when I load an image of the fault when loading the image, the…
-
0
votes1
answer152
viewsUsing Unicode in a variable char
Guys like me to use unicode in C? I just don’t know how to store the 2 bytes of one unicode on a char, that’s all, someone knows how?
-
0
votes1
answer797
viewsASCII value for char or Int value for ASCII C
Guys, I need to search for a value found by a rand in a file, I’m having a lot of problems because the rand returns me an integer and to fetch character in a file the fgetc me returns an integer…
-
0
votes2
answers12933
viewsMultiple conditions on an if
I have a code here, and I need to put several conditions within an IF. In case I need to put it that way: if (X->meia != 's' || X->meia != 'S' || X->meia != 'N' || X->meia != 'n') {…
-
0
votes0
answers147
viewsHelp with Lexical Analyzer
Good evening everyone. I’m implementing a c/c++ lexical analysis, but I’m having a problem with the output. I was asked to leave the program with only 3 variables and 2 operands, plus 1 delimiter…
-
0
votes3
answers1132
viewsProblem with vector in C
I don’t know where it’s wrong, if I put the value 7 in matrizA and 7 in matrizB and 14 in matrizC that will accumulate the value of A and B, for sure but if I place above 14 error. Make a program to…
-
0
votes2
answers317
viewsHow to write in sublime text?
I downloaded the sublime text, and set it to program in c, but the scanf doesn’t work, it shows the variable value, I can’t type. #include <stdio.h> void main() { int x; scanf("%d", &x);…
-
0
votes2
answers211
viewsCreate chained list with realloc()
I need to implement a simply chained list that does not have a next indication, that is, it should function as an array, accessing nearby positions in memory. I’m using the realloc() command to try…
-
0
votes1
answer848
viewsRow with circular chained list with head
Implement a queue in a circular chained list with head (do functions that implement the operations of Insertion and Removal). The first Row element is in the second cell and the last element is in…
casked 9 years, 6 months ago Matheus Francisco 650 -
0
votes1
answer106
viewsWhat is the operator << in the context of virtual memory paging?
I’m seeing the implementation of virtual memory and I have this code: #define INDEX_FROM_BIT(a) (a / 8*4) #define OFFSET_FROM_BIT(a)(a % (8*4)) static void set_frame(u32int frame_addr) { u32int…
-
0
votes1
answer346
views"strstr()" function is not locating what I expect
#include <stdio.h> #include <string.h> char tracks[][80] = { "I left my heart in Harvard Med School", "Newark, Newark - a wonderful town", "Dancing with a…
-
0
votes1
answer228
viewsAssign element to matrix only when there is space?
I have some vectors that should be assigned in a 20x20 matrix, but no vectors can override each other and not be printed in different lines, they should be assigned vertically or horizontally. For…
-
0
votes1
answer137
viewsHow to read a certain number of lines in C?
This is my code that reads and searches a certain word, void* pthread_wordCounter(void* parameter){ int count = 0; size_t linesize = 0; char *linebuf = 0; ssize_t linelenght=0; static const char…
-
0
votes1
answer81
viewsReceive character in C
How do I do a function in C equal to the function Readkey of Pascal or equal to the function Lastkey of the old man Clipper? I want to receive only one character separately for each key pressed.…
-
0
votes1
answer1166
viewsHow to remove negative elements from a queue?
Good afternoon, you guys, I’m trying to remove a negative element from a queue, we can put the elements in the queue but when removing the element it always removes the first element... This is the…
casked 9 years, 6 months ago AleBabaloff 1,104 -
0
votes1
answer3481
viewsFailure to read char with scanf ("%c")
Check this code to register two random matrices and then add, multiply... I want to put an option that every operation made the user has the option to quit the program, without going back to the…
-
0
votes1
answer70
viewsWhy can’t I print content in Chained List
Good evening, I have a problem with a college job. I need to create a linked list that receives student records. I created a function to register, however, I can not print, externally, the contents…
-
0
votes1
answer111
viewsCast struct c/c++
Guys I’m seeing a code of a network Sniffer and I’m not understanding the following lines : ethernet = (struct sniff_ethernet*)(packet); ip = (struct sniff_ip*)(packet + SIZE_ETHERNET); how do these…
casked 9 years, 5 months ago alexsander 483 -
0
votes1
answer71
viewsComparing char variable in C
#include <stdio.h> #include <string.h> #include <stdlib.h> int main() { struct cmd1 { char cmd[20]; }; struct cmd1 cmdd; char cmd_ti[3] = "ti"; char cmd_tela1[2] = "a";…
-
0
votes2
answers105
viewsFor rule in C
I have a doubt about the cycle being , that is, I have an instruction for and I have to get the result that the machine gave. have this : for(x=2,Y=1;X < 11;x++)y+=x++ I know the X variable…
-
0
votes0
answers55
views -
0
votes2
answers1797
viewsStore values of a string in an array
I need to make a program in C that takes a sequence of numbers, stores the values in a vector and then prints this sequence in the reverse order. It must receive two entries, the first is an integer…
-
0
votes1
answer385
viewsPass values to a struct
Good afternoon. I am in doubt whether it is possible to pass values to a C struct using JSON, Hibernate or some other known method?
-
0
votes2
answers277
viewsDisplay the first 5 divisional numbers by 3, discarding the number 0
I’m not able to display the first 5 divisibles by 3, I put a counter variable, but it returns another number. #include <stdio.h> #include <stdlib.h> int main() { int n = 20; for(int i=1;…
-
0
votes2
answers174
viewsUse pointer on struct
I wanted to know how to access a certain element of a struct the way I’m defining it. Here’s my struct: typedef struct { char *produtos[200000]; int contador; } Produtos,*ProdutosP; Defini ProdutosP…
-
0
votes1
answer234
viewsWhy does this seemingly simple implementation of "strupr" not work?
Error implementation in GCC: char* strupr( char *str ) { while(*str) { *str++ = toupper(*str); } } Note that str is used twice in the assignment.…