Questions tagged as 'c'

1
answer

Reading only integers in c

I'm new to programming and I'm having a problem, I made a code that reads three integers. #include <stdio.h> #include <stdlib.h> int main () { int i,v[3]; for (i = 0; i < 3; i++) { printf("Numero:"); scanf("%d",&...
asked by 09.10.2018 / 02:49
1
answer

Removing specific element from a double-linked list

I created a function to remove a specific element from a list. However, the code only works right when it comes to the first element. The logic is that when the element arrives in which it concerns it takes the previous / next and clears the spe...
asked by 02.10.2018 / 22:34
0
answers

How to use the ntohs function correctly?

Hello, I'm having trouble converting network byte order to host byte order with ntohs() ". I do not understand why the conversion is giving problems, because the function I am using to convert host byte order to network byte order...
asked by 04.10.2018 / 00:59
0
answers

Doubt about numbers Subscripts in C

Is there a method for me to put Subscribed numbers? Example: printf("A) A SOMA EQUIVALE À 11001011010 ²\n"); Instead of displaying an Overrides number, I wanted it below (Subscripts), to show it as a binary basis and not a potentiation....
asked by 02.10.2018 / 18:54
0
answers

How do I declare an integer with 30-byte storage capacity?

My question is: I know that the Python language interpreter is made in C. In Python numeric variables do not have size restriction, that is, the more we add value to the variable, the more the variable increases the amount of bytes so that it is...
asked by 11.10.2018 / 00:24
1
answer

How to use struct member variable to preset array size

I would like to know how to pre-define the size of an array inside a struct of the form: struct exemplo{ int l; int c; int matriz[l][c]; }; The compiler complains that l and c in the array row is not declared here.     
asked by 22.09.2018 / 23:41
0
answers

With making a list point to another in C

I'm in doubt as to how my LETRAS list points to CONTATO . Every time I type a new name I need to save the initial of the name and point it to the names that contain the initial one, but I'm having trouble implementing it. #include...
asked by 22.09.2018 / 03:28
1
answer

Warning: assignment makes pointer from integer without a cast

I did a search but I did not quite understand what this means and what it says about my code. I have this function cria_palavra that returns a pointer, there in main , when I will receive that return in another function insere_fi...
asked by 22.09.2018 / 09:13
3
answers

Fibonacci sequence does not work [closed]

I have a problem with the output of the Fibonacci sequence and I can not identify where the error is. Here's the code: #include <stdio.h> #include <stdlib.h> int main(){ int i, Fib[100], n; scanf("%d",&n); printf("0 "); fo...
asked by 07.10.2017 / 17:14
0
answers

Control servo motor and brushless motor

I have a nano Arduino and need to move two components via bluetooth: a servo motor and a brushless motor. In the Android app, step two variables: one for port 4 and one for port 5. On port 4 is Servo motor and on port 5 is the brushless motor...
asked by 29.09.2018 / 16:32