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
-
-1
votes2
answers390
viewsUse of EOF in vectors
Good evening, I wonder if in this program I am using the EOF(end of file) right, IE, while I do not type 0, the vector will be allocated and recorded with a value?? Follows code below: #include…
casked 9 years, 11 months ago Gabriel Vinicius 339 -
-1
votes1
answer54
viewsBootloader - programming
I’ve seen that code from a bootloader : https://ghostbin.com/paste/mwpub And I can’t understand that part : MBOOT_PAGE_ALIGN equ 1<<0 MBOOT_MEM_INFO equ 1<<1 Well I wonder what that…
casked 9 years, 7 months ago alexsander 483 -
-1
votes2
answers205
viewsLanguage that Autodesk software uses
I’m wondering in what language the Softwares da Autodesk are written and the name of the GUI used. If you can help me with this information.
-
-1
votes2
answers280
viewsCheck the diagonal of a specific index
I wanted to know how to check the diagonal of a particular index, for example, put 1 in all the numbers of the diagonals of row 2, column 2 0 1 0 1 0 0 1 0 0 1 0 1 1 0 0 0…
-
-1
votes1
answer438
viewsHow to pass a pointer inside a struct per function parameter?
The situation is as follows: I have a struct with a field that is a pointer pointer, however I want to pass as parameter in a function only the pointer pointed, that is, the innermost pointer of…
-
-1
votes1
answer209
viewsHttp server in c
Gelera would like to understand this line of code: complete code: https://dzone.com/articles/web-server-c if (strncmp(request, "GET ", 4) == 0) { ptr = request + 4; } Why add + 4 ?…
-
-1
votes3
answers138
viewsHow to declare variables in for in c?
It error, when I try to declare a variable in a loop as for, while. Before I could, it has to do with the language version?
-
-1
votes1
answer49
viewsHelp in function with pointers
Can anyone help me with this code ? not working, can’t find the error. #include <stdio.h> int chamar(int *n){ printf("Digite o valor de n:"); scanf("%d",&n); printf("%d",n); return 0; }…
-
-1
votes2
answers171
viewsAdd a char on a char pointer in C/C++
I need to add a char on a pointer of char. For example: I have a pointer of char called name, which receives "log", after the process, I want it to be "log1". I tried to implement it like this, but…
-
-1
votes1
answer4866
viewsHow to add or remove a vector element?
From a vector, how can I remove or add an element?
-
-1
votes1
answer865
viewsConversion from flowchart to code
I am trying to convert a sizable size flowchart to Arduino code. The flowchart is as follows:: Considering your size, I’d feel more comfortable using the remote goto as a flow control. However I…
-
-1
votes1
answer856
viewsHelp with C Text Editor
I’m having some trouble making a text editor there will some of them: 1 - I don’t know how to delete a line; 2 - I can’t move with mouse arrows up and edit a line of text and save in sequence; 3 -…
-
-1
votes1
answer900
viewsThe program is not reading the matrix numbers
I’m doing exercises on Uri online Judge, this asks: In this problem you should read a number, indicating a row of the matrix on which an operation must be performed, a capital character, indicating…
-
-1
votes1
answer317
viewsFunction with pointer to pointer
I have the following function NOTE: In this function is only the first case, so it doesn’t get too big. Since the error occurs right at the first insertion. int insertAVL_TreeR(struct AVL_TreeNode…
-
-1
votes2
answers622
viewsRepeat loop for in C
I have to do the following exercise: Read 3 whole values and order them in ascending order. At the end, show the values in ascending order, a blank line and then the values in sequence as read. The…
-
-1
votes1
answer73
viewsType error in return of a derivative function
I have the following C code, I am compiling it on linux using gcc and -lm (see below) What happens is the following: f(x+dx) - f(x) gives zero ( which is not! ) The functions f(x+dx) and f(x) are…
-
-1
votes2
answers1809
viewsHow to return to the menu after performing function?
I would like to know how to do after adding it() just returned to the menu. Someone helps? #include <stdio.h> #include <stdlib.h> char descricao[40]; void adicionar(){ FILE * pFile;…
casked 8 years, 11 months ago Pedro Carvalho 61 -
-1
votes2
answers331
viewsIs there any way I can change the range of the Rand function in the middle of the C code?
Hello, I was solving a college issue about a "game" in which you should think about a number and the machine should try to hit your number. I was able to do this work by creating a "formula" for him…
casked 8 years, 11 months ago Victor Hugo 1 -
-1
votes1
answer234
viewsAccess computer Bios source code
Is there any way to access the source code of my computer’s Bios? using Assembly or c?
-
-1
votes1
answer720
viewsSudoku game resolution giving infinite loop in C
I have the following code on C: #include <iostream> #include <stdio.h> #include <stdlib.h> #include <time.h> // Variáveis globais int jogo_tabuleiro[9][9] = {0}; int…
-
-1
votes2
answers159
viewsI can’t keep the string
void ex51(char *nome_ficheiro){//escrever e criar um ficheiro novo. char frase[100]; printf("Introduza o texto que quer escrever neste ficheiro:\n"); scanf("%s",frase); FILE…
-
-1
votes1
answer694
viewsError using Pow(a,b)
#include <stdio.h> #include<math.h> int main() { double pi = 3.14159; double R, A; scanf("%lf", &R); A = (pi)* pow(double R, int 2); printf("%lf\n", A); return 0; } This code is…
-
-1
votes1
answer1283
viewsCreate exclude function in C project
I have created a school library project. I have no idea to create delete function: #include<stdio.h> #define MAX 15 typedef struct TAutor { char Nome[40]; char Pais[20]; char cidade[30]; char…
casked 8 years, 9 months ago Ezequiel dos Santos 7 -
-1
votes1
answer147
viewsDynamic List with void pointer insert at start
t_lista* Cria_Lista(int (*ptrFncEscreve)(void *ptrElemento)) { t_lista *Lista; Lista = (t_lista*) malloc (sizeof(t_lista)); Lista->qtde = 0; Lista->ptrFncEscreve = EscreveInteiro; return…
-
-1
votes1
answer1088
viewsHow to read a variable of type unsigned char by the fscanf function?
I am reading an array of a file where each element of this matrix varies from 0 to 255. For this reason I have stored the values within an array of unsigned char type, but am finding some problems…
-
-1
votes2
answers507
viewsDoubts about the compilation and "linkage" phase of a C-Program
I have some questions about the steps used to compile a program in C. I have as source of study the book of Luis Damas (I know it is not advisable to have only one...), where he says that the…
-
-1
votes1
answer118
viewsPrint a square where prime number positions receive a "#" and the others receive a "_"
#include <stdio.h> int main () { int n, i, j; printf("Digite o tamanho do quadrado\n"); scanf("%d", &n); for(i=1; i<=n; i++) { for(j=1; j<=n; j++) { if(i%j == 0) { printf("#"); }…
-
-1
votes2
answers3403
viewsLargest number function in a tree
I’m developing a function of returning myself the largest number of a tree. I am trying this code, but I did not succeed in its compilation, printing -1 on the screen, while it was to print only the…
-
-1
votes1
answer1321
viewsInserting in circular list
I am having doubts in this code of the function of inserting circular list. tipo_lista * inserir_inicio (tipo_lista * p, tipo_lista * novo_no) { //Se a lista estiver vazia if(p==NULL) return…
-
-1
votes1
answer374
viewsHow to take the least significant bit of a character and hide in an image file?
the programme verifying whether a particular LSB has been modified, how to proceed?
casked 7 years, 10 months ago Italo Zuckerberg 63 -
-1
votes1
answer493
viewsCopying the contents of a file to vectors in c
Guys, I’m trying to copy a file that has several products, a line with the name and the following with the code, price and quantity. I tried to pass each line to an array, but it’s not working. When…
-
-1
votes2
answers924
viewsfgets does not work
I’m developing a code to encrypt in the cesar cipher. The decryption is working perfectly, but to encrypt, the fgets Don’t wait for me to type in the text. I’ve tried everything, the only command…
-
-1
votes2
answers2300
viewsHow to use command line parameters
I’m doubtful about the use of the command line parameters, like, one of the functionalities of the university’s job is to treat some arguments per command line, for example: ./program -e -i file.txt…
casked 7 years, 9 months ago Italo Zuckerberg 63 -
-1
votes1
answer68
viewsVariable-sized Object may not be initializad
Problems in C. This error is showing: Variable-sized Object may not be initializad What to do to fix this error? Since I have already initialized everything. LINE 66, 67 and 68 #include…
-
-1
votes2
answers903
viewsExercise in C, printing of change
Consider four coins, 25 cents, 10, 5 and 1. Build a C program that asks the user how much he wants to receive in change and then print out the amount of coins needed to pay the change, always…
-
-1
votes1
answer977
viewsId returned 1 Exit status
A number is said to be Capicua when read from left to right is the same as when read from right to left. For example: the number 320023 is Capicua, while the number 1872681 is not. Then construct a…
casked 8 years, 4 months ago Filipe Teixeira 37 -
-1
votes1
answer96
viewsDoubt Nesting of Structs
I need to make a program that registers product and include these products in a shopping cart and finalize the sale. Before I had done a program that registered the products, which contained only…
-
-1
votes2
answers68
viewsVector by Parameter in C
I need to pass the Vector position by parameter as follows code, my function receives the address and modifies directly the variable passed by parameter. But the program stops working and closes…
-
-1
votes1
answer493
viewsFor without the use of key
#include<stdio.h> int main ( void ){ int row; int column; for ( row = 1; row <= 7; row++ ){ for (column = 1; column <= row; column++ ) printf("*"); printf("\n"); } printf("\n"); } I want…
-
-1
votes3
answers6852
viewslanguage c is giving me a small error and I can not correct
I have to do a job and it’s giving me a mistake that I’m not able to fix, the mistake says: assignment to Expression with array type The error is in the void inicializarcategoria()I really need help…
-
-1
votes1
answer478
viewsExercise: Turn decimal to binary and find 1’s
#include<stdio.h> int main() { int k,repeticao; int valor, numero; int paridade = 0; scanf("%d", &repeticao); for( k = 0; k < repeticao; k++ ){ int numero,sequencia; scanf("%lld",…
-
-1
votes1
answer455
viewsScanf inside the printf
#include <stdio.h> #include <stdlib.h> int main() { int i; printf("digite um número %d",scanf("%d",&i)); } The following program only gives the result 1 and I do not understand why.…
casked 7 years, 4 months ago jose machado 21 -
-1
votes3
answers264
viewsSource code does not compile
#include <iostream> /* run this program using the console pauser or add your own getch, system("pause") or input loop */ int main() { float parede,…
-
-1
votes1
answer58
viewsProblem on the list
The list should insert the fields of struct trucks and then print them.But when I ask to print, only the first insertion appears. #include <stdio.h> #include <stdlib.h> #include…
-
-1
votes1
answer49
viewsWhat would be the name of this "technique"?
int valorNo = (p->left == NULL && p->right == NULL) ? p->key : 0; I saw it in an answer here in the stack and I have no idea how it works, much less how to "read" it.…
-
-1
votes2
answers515
viewsEven stack and odd stack logic error
Guys I got this code down, it works, only it’s weird, it doesn’t print the last position. #include <stdio.h> #include <stdlib.h> #define TAM_PILHA 2 #define NUM_ENTRA 5 void empilha(int…
-
-1
votes1
answer146
viewsProgram does not execute when filling vector with non-repeated random numbers in C
I’m trying to get random numbers to be generated and fill in a vector in a separate function, but the program doesn’t run and crash if I put a high number, and not as high as 50 or 100. Below…
-
-1
votes1
answer55
viewsProgram with 3 files
I made a code in c++ that works if it’s all inside the main.cpp. When I create other files, like a header it from the indefinite reference error. I have done everything and only managed to make it…
-
-1
votes1
answer322
viewsWrite to C files
Eai personal. I need to do a work in C that I have to create files with numerical sequences and create another file with the intersection of those numbers and such... However, I can’t write these…
-
-1
votes3
answers33840
viewsC - how to calculate the factorial of a number?
I’m trying but I’m not getting it, for example: factor 5 is given by 5 * 4 * 3 * 2 * 1. You have to develop a program that calculates the factorial of an input number. (using )