Questions tagged as 'c'

2
answers

List item causing error in program C

Good evening guys. I'm having a problem with a simple code, for a college job where I can not figure out why, since Dev-C ++ does not report any errors. To prevent someone from my college find this topic by chance and copy my code, I will use...
asked by 30.06.2018 / 01:52
2
answers

Problem with printing repeated numbers in C

The question asked me to make a code that would store 10 integer values, check if there were any numbers repeated, and if there were, print the repeated numbers, but my code or printe some numbers repeated more than once, or printa one once. How...
asked by 23.09.2018 / 00:52
1
answer

Divide the program with libraries .c and .h

Friends, I just made a program to calculate the transposed matrix. My question is: how can I make this program work, so that I have two more files (one .c and one .h) besides main.c ?! I hope you have understood my question. Here is my code in C...
asked by 15.06.2018 / 06:23
2
answers

How to have a cycle range up to \ n and up to \ 0

In a validation function that passes all the tests will return 1, and if it enters one of the conditions it will give return to 0. I want to loop through the line break, so I'm using the range: for(int i=0;dados[4][i]!='\n';i++){...
asked by 13.06.2018 / 16:43
1
answer

Is the null character \ 0 automatically placed at the end of the string or does it not put because I set the scanf limit?

#include <stdio.h> #include <stdlib.h> int main(void) { char nome[20]; char sobrenome[20]; char nomeSobrenome[40]; printf("Insira seu nome e seu sobrenome:\n"); //scanf("%s%s", nome, sobrenome); scanf("%[A-Z...
asked by 03.09.2018 / 22:43
1
answer

Character unpacking

I'm having difficulty in the following exercise    Using the right shift operator, the AND operator on bits, and a mask, write a function called uncompressingCharacters that receives the integer   unsigned and unzip it into two characters fro...
asked by 03.09.2018 / 14:48
1
answer

Statement of Pointers in a struct and calling it in function

I should solve the following problem by creating a function for reading, one for calculation and use pointers. #include<stdio.h>#include<stdlib.h>#include<math.h>structponto{intx;inty;}ponto1,ponto2;structponto*p1,*p2;p1=&a...
asked by 18.05.2018 / 13:50
2
answers

Create directories in c ++ with Linux

I want to create a directory in the home folder with c ++, but there is no way to do this in a cross-platform way. I have found that in the "sys / stat.h" library has the mkdir function that creates directories, but in addition to the directory...
asked by 22.05.2018 / 19:26
1
answer

Syntax errors in C [closed]

I'm doing this exercise in C, but I caught that part of passing pointer parameters. Basically the program below adds the portion of real numbers and integers. The problem is that the current results are: a = 12 (correct!) b = 10 (...
asked by 31.05.2018 / 18:55
2
answers

Specific libraries and C compiler defaults in Windows and Linux

I'd like to know why conio.h and strrev() of library string.h , there is no Linux. Is there anything else that can only be done in Windows? And why this happens? Is there anything that can only be done on Linux? I did some...
asked by 04.06.2018 / 15:57