Questions tagged as 'c'

2
answers

Create define for 16-bit variable consisting of two 8-bit

I would like to know if there is any way to create a define for a "variable" in C that has 16 bits called PORTAB , so write: PORTAB = 0xAAFF; Be equivalent to: PORTA = 0xAA; PORTB = 0xFF; Thank you.     
asked by 03.09.2017 / 22:45
2
answers

Is it possible to do multiplication and division mathematical operations using pointers to structures within global structures in c?

#include <stdio.h> #include <stdlib.h> struct end{ float rua; float cep; float soma; }; typedef struct dados{ struct end e_end; float idade; float peso; }dados; dados *p_dados; p_dados=...
asked by 19.09.2017 / 16:12
0
answers

Questions about allocation Dynamic [closed]

How do I get C to get a variable, as in the example below, to make N = vector. If I'm to play N in another function and put it inside a for , then I want to reallocate the vector value by increasing N times. And thus increasing N propos...
asked by 02.09.2017 / 06:32
1
answer

Problems with header in.h

I'm using the code below to check the computer's ip, but Code Blocks is giving error. #include <ifaddrs.h> #include <ip.h> #include <stdio.h> int main() { struct ifaddrs *id; int val; val = getifaddrs(&id); printf("Netwo...
asked by 31.08.2017 / 14:47
0
answers

Communication with keyboard with PS2 display

I need to develop communication with the display of a keyboard (44 keytec brand keys) using windows. In C, for linux, using #include, the inb () and outb () functions work correctly. For windows, the closest I got was to find inpout32.dll,...
asked by 29.08.2017 / 19:23
1
answer

Chained Allocation - Data Structure - C

Consider a storage area of 5 nodes. On this area will be mounted a list simply chained with increasing order by the field INFO, of name LIST. Initially create the PND and NODO-HEAD to make this list operational. After, show the behavior of the l...
asked by 05.09.2017 / 00:39
1
answer

Error in array as function parameter

Good evening. I'm having a problem using an array as a parameter in my functions. I have a function that has an int array as a parameter, when I call the array an original array, and in the function I manipulate the parameter and saved in an...
asked by 11.08.2017 / 04:51
1
answer

How can I pass String.concat "/" [""; "Usr"; "local"; "Bin"] for c?

I know a lot of things in c, however, this is new to me, but, see below with OCaml: Generating a component filename: Note that the second argument is a list of strings.    String.concat "/" [""; "usr"; "local"; "bin"]    It's very simple...
asked by 23.08.2017 / 16:58
0
answers

Array vector has n elements, but lenght returns "n + 1" in C

Hello, I have the following question: I have a vector and I'm sure it is passed to it only one element through the following loop: char uid[1]; while(indice1 < indice2){ printf("Valor de indice 1 %d, indice 2 %d\n", indice1, indice2)...
asked by 26.08.2017 / 13:47
1
answer

GetOpenFileName () used with user impersonation

I have a process that needs SYSTEM privileges and for this to be released by a service. When this process runs the GetOpenFileName () to open a select files dialog, I get an error message saying    C: \ Windows \ system32 \ config \ systemp...
asked by 24.08.2017 / 13:41