Questions tagged as 'c'

2
answers

The semantic difference of "Malloc" and Calloc "

I was in the programming class with C and I was wondering about the difference between Malloc and Calloc , but not in what each one does, but in the meaning of "M" and "C". I know that Malloc comes from memory al...
asked by 01.11.2017 / 12:22
1
answer

Language C - Summation problem within a function [closed]

Good afternoon. The program has the following purpose. I have to send the user to enter how many students the room has, so that he sends that number to a function (in this case, each subject is a function), and within these functions I have a...
asked by 29.10.2017 / 21:17
1
answer

How to find a name with struct

I'm making a code that will get the names of 5 people and the 3 gifts that she took to party, and then will be asked the name of the person and the gifts she brought to party, and show if there is or not, but when I try to compare, it never finds...
asked by 19.01.2018 / 23:28
1
answer

How to convert string to int type in c

I tried to use itoa, but it seems that the platform uri does not accept, somebody could give me another way to convert from string to int Here is the code I tried itoa(n1, p1, 10);     
asked by 30.01.2018 / 13:08
1
answer

Turn on led with arduino using strings

   Perform code that causes the D1 LED to be off when an odd decimal numeric digit of between {1,3,5,7,9} is sent from the PC to the arduino and lit if the sent digit is between { 0.2,4,6,8}. How would I do this? That's what I've done so...
asked by 11.01.2018 / 19:21
1
answer

How do I vector product by matrix and between matrices?

I can not think of a for doing this multiplication, because the number of columns of the first array has to be equal to the number of rows of the second array ...     
asked by 16.10.2017 / 00:45
1
answer

How to view contents of a .bin file generated in c

I had to create a program in C that reads a motion sensor activation file (.txt) and produces a binary file with the same information. The .txt file has the following information: 3B2 20051023 014857393 609f 3B3 20051023 014857393 00f...
asked by 16.10.2017 / 16:43
1
answer

Read matrix of a file diagonally

Hello I have a fixed-length file that has an array of random characters. However I am having difficulty using fseek and fread to read the file diagonally. To explain the problem, I need to make a kind of hunting words that search words hor...
asked by 25.09.2017 / 20:41
1
answer

How do I fix "undefined reference to 'function' in C?

Here is a simple example of TAD, which displays the error. file.h #include <stdio.h> #include <stdlib.h> int teste(); file.c #include "arquivo.h" int teste() { int a=5, b=10; return a+b; } main.c #include "a...
asked by 29.11.2017 / 16:34
2
answers

Allocation bursts memory into recursive function in C [closed]

I created a program that is allocating 4 bytes of memory successively through a recursive function: #include <stdio.h> #include <stdlib.h> #define BUF 2 void overflow(int payload){ payload = payload - 1; int stack = (int)m...
asked by 12.09.2017 / 21:14