Questions tagged as 'c'

3
answers

Perfect 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 taking the root and then checking if the rest of the division by 1 is greater than zero, except that the operator (%) only works with integers and sqrt...
asked by 03.10.2015 / 22:43
3
answers

Problem with vector in C

I do not know where it is wrong, if I put the value 7 in the matrizA and 7 in the matrizB and 14 in the matrizC that will accumulate the value of A and B, of course but if I put above 14 of the error.    Make a program to...
asked by 26.09.2015 / 04:33
1
answer

Use data generated 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 so on, however, that identifier needs to be us...
asked by 21.10.2015 / 05:12
1
answer

The function writes to the file in txt. I need to do the sum but the vector is like char

My teacher passed this code that writes to the txt file. Enter random number. After running this code it wants me to do the sum of the values written in the txt, but they were written in a vector of char and for me to make the sum I need to conv...
asked by 02.06.2016 / 01:13
1
answer

Comparing 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"; printf("\nTeste ->...
asked by 29.10.2015 / 21:53
1
answer

Printing problem with C

Good morning. I have a problem solving a question of an issue here in college. Here's the question. Theteachergavethesourcecode(following)#include<stdio.h>#include<stdlib.h>#include<locale.h>#definedimencao10typedefstructce...
asked by 31.08.2015 / 16:24
1
answer

How to check elements close to a specific element in an array?

The goal is to try to find on the college campus possible locations for building a new building. The user will type the matrix that represents the college plan. R = Ruas P = Prédios V = Área Verde E = Estacionamento R R R R R R R R R R R R...
asked by 10.06.2015 / 18:28
2
answers

String printing problem

I would like to know the problem of my string inside the function, it goes through the string and when I find an uppercase letter turn it to lowercase (I already tried to use tolower and isupper , but it did not work) and when find...
asked by 11.06.2015 / 04:02
2
answers

File manipulation

Hello. I have a problem with handling create and manipulate a file in C. First I made the whole code using a struct and functions, it worked everything right. I put the commands to create the file and it is also ok. My problem is when you ope...
asked by 20.06.2015 / 22:07
1
answer

problems with 'multiple definition of ...' in .O files

Hello, I'm doing a program to study lists and I'm having a problem with the definitions of the functions, I tried to solve with my data structures teacher but I could not get it right, if anyone can help me, my code is this: main: #include &...
asked by 08.06.2015 / 14:55