Questions tagged as 'c'

2
answers

C program to generate terms of a P.G

I'm a beginner to the C language, and I encountered a problem in the code below. The problem is this: The program runs perfectly, however, when entering values like (1-5-3), the program, which should return (1-5-25), returns (1-5-24) . I've...
asked by 27.04.2015 / 02:42
2
answers

Sort query - Language C

I'm sorting a simple, growing vector. The code works. But the following line in which left me confused: if (matriz[i] < matriz[j]) Why is the sign there smaller, not larger? If I want to change the positions, if the i position...
asked by 27.04.2015 / 21:34
2
answers

Problem to remove list element chained in C

My role is only removing the first element if I enter the name of this first element. I would like to know how I do for the function to find the element and remove it. The insert function is working so I will not put it .. Follow the code: t...
asked by 30.05.2015 / 20:29
1
answer

Problem creating search function in C

The fetch function receives the address of the first element of a list (p) and a string (subname). Assuming that Francisco subname of the person name matheus francisco will return it to me instead of NULL . I'm having trouble...
asked by 25.09.2015 / 23:25
1
answer

Integration error "Java" and "C" through JNI

I am not able to consume functions of a "C" lib using Java with JNI. Here are my artifacts and the error generated. Class CalculadoraJNI : public class CalculadoraJNI { // Declaração do método nativo: public native int calcula...
asked by 01.11.2015 / 20:01
2
answers

How to convert string array to string?

In a program for Arduino, I have an array of strings but it seems that the function where I am going to use this data only accepts string. How do I convert an array to a string? File prog = SD.open("prog.bin"); String leiaS(void){ return...
asked by 01.07.2015 / 19:21
1
answer

Atomic operations in ARM without Visual Studio

When programming in C / C ++ on the x86 and x86-64 (AMD64) architecture and using the Microsoft compiler that comes with Visual Studio, there are two intrinsic functions to perform atomic operations, _InterlockedCompareExchange32 and _I...
asked by 20.06.2014 / 17:31
3
answers

Struct and chained list

I created a person-type structure and I want to use it in a linked list, but the following errors appear:    'No' has no member named 'data', 'No' has no member named 'prox' and unknow type name 'p'. The program did not even run, can anyo...
asked by 25.06.2014 / 20:58
2
answers

Can I return a struct by initializing it inside a return in ANSI C?

Good morning, I'd like to know if I can do something like this ... typedef struct Result { int low, high, sum; } Result; Result teste(){ return {.low = 0, .high = 100, .sum = 150}; } I know this would not be a right way, but is there...
asked by 06.09.2014 / 15:36
1
answer

Chained lists - add at the bottom of the list

To have problem at the time of executing this code, whose objective is to add an element at the end of the list, the program is waiting for something that I do not know what it is, then the program of the error. Any light? To start now lists,...
asked by 28.02.2014 / 00:23