Questions tagged as 'c'

2
answers

Struct with pointer and allocation

I can not use fscanf in a structure, I have already allocated structures. #include <stdlib.h> #include <stdio.h> #include <string.h> struct Cliente { int numero; char *nome; }; struct Filme { int numero;...
asked by 27.04.2014 / 20:30
1
answer

C language, matrix exercise [closed]

#include <stdio.h> #include <stdlib.h> int main() { int matriz[5][5]; int i, j, posicao=0; int maior = matriz[0][0]; int menor = matriz[0][0]; int posicaoI=0, posicaoJ=0, posicaoi=0, posicaoj=0; srand(t...
asked by 06.12.2018 / 01:00
1
answer

Discover winner Game Cock / Old Game

I'm developing the rooster / old game and in this game I have to check every new move or iteration if there is any winner. I started by trying to do this for a static array predefined by myself and also started by doing the check first by deleti...
asked by 28.12.2018 / 10:38
1
answer

Optimization with GCC

Recently I've been wondering if it's possible for the compiler with some flag optimization, avoid copying two arrays to the .rodata section? Thus, memory addresses would be the same, eg const char str[7] = "string"; const char str1...
asked by 31.10.2018 / 03:13
1
answer

Equal elements between vectors - C

I'm trying to solve a problem early on which is as follows:    A school wants to know if there are   disciplines Logic and e Programming language. Enter the numbers   of the students that study the Logic in a vector at most   of 5 students. E...
asked by 29.10.2018 / 21:28
1
answer

Struct Vector: Pass by reference in C

This code is a simple register of people, containing code and the person's name. I am confused as to passing the struct vector to the "insert" procedure. When compiling, the program stops working. In the compiler I get the following error: "P...
asked by 30.10.2018 / 19:38
1
answer

Warning: "No local application has been provided. You can define it in the Run menu, Parameters "Dynamic DLL Creation problem in C ++ in DEV ++

I'm trying to create a DLL with the code that the teacher passed, but it does not compile properly. The warning is appearing:    "No local application has been provided, you can set it in the Run menu, Parameters" What would these Par...
asked by 04.11.2018 / 15:01
2
answers

want to read more than 1 .txt file in C [closed]

I wanted to create multiple .txt files and did this through a loop, and I did. But the only way I can read all the files is by doing another loop, for example: it does a looping of 3 passwords, that is, I created 3 passwords, 3 .txt files, but a...
asked by 03.11.2018 / 03:35
1
answer

Stack operations

I am trying to do operations using stack but at the time of allocating the results in the previous position in the stack it is that I am not succeeding because the result of the operation is not allocated in the desired position: I'm trying t...
asked by 05.11.2018 / 01:56
1
answer

Execution error on switch

#include <stdio.h> #include <math.h> int main () { int n1, n2, operacao, soma, sub, mult; float div; printf("Escolha a opecaracao que deseja realizar: "); scanf("d", &operacao); switch(operacao) {...
asked by 27.09.2018 / 18:27