Questions tagged as 'c'

1
answer

What is the purpose of using inline functions in the C language? [duplicate]

I would like to know what is the purpose of inline functions in the C language? Is there any performance difference or other features that should be taken into consideration compared to common functions? Example of an inline function...
asked by 30.01.2016 / 23:10
2
answers

Doubt in recursive function

When I post: return n * fatqua(n-1) The program returns the expected result that is 24 . But when I post: return n * fatqua(--1) The result of the program is 0 . I can not understand the logic of this operation. Fol...
asked by 02.11.2016 / 17:17
1
answer

Is it correct to return a memory address in function?

I was asked to design a function that was called, open a .txt file and return the pointer of this file, that is, return a memory address. However, as far as I know the memory is only temporarily allocated to functions, ie after the execution of...
asked by 29.08.2015 / 19:30
2
answers

Infinite loop trying to calculate whether the number is prime

I have no idea how I will determine the condition of for for prime numbers. I always end up in looping . #include <stdio.h> int main() { int num = 1, primo; do { printf("Informe um numero primo maior qu...
asked by 06.09.2015 / 06:07
2
answers

Test prime numbers in C

I'm trying to develop in C a program in which the user places a sequence of numbers and it must determine whether the numbers are prime or not. Here is my code: #include <stdio.h> int main() { int num1, num2, i; char op;...
asked by 03.09.2015 / 01:25
3
answers

While repeat structure to recalculate in C

I solved this exercise below and thought about putting a while repetition structure, so the person recalculates. But when I put 's' to return and recalculate, the exercise sums up the values of the 10 numbers I previously calculated and a...
asked by 11.09.2015 / 23:44
2
answers

Add JNI Library Compilation with maven or ant tasks

I'm creating a Java project with native methods ( JNI ) without having to create three separate projects for this. My goal is to compile everything I need in one go. I use only one DLL / OS in this project generated by a single C file. How...
asked by 08.10.2014 / 19:07
1
answer

What is behind the dynamic allocation function malloc ()?

What mechanisms does the malloc() function use in practice to manage dynamic memory allocation in a program?     
asked by 29.06.2015 / 20:41
1
answer

How to compile C file using Sublime Text in Windows 8.1 64 bit?

I installed Sublime Text in Windows 8.1 64 bit. How to compile a * .c file through Sublime in Windows? Is it necessary to install a compiler and / or another program to alert code errors and create the executable file so that I can tes...
asked by 01.02.2014 / 23:12
1
answer

Matrix of strings

How do I declare and start an array of strings ? I tried in many ways and I still did not succeed, I thought it would work fine but it did not work. #include <stdio.h> #include <stdlib.h> int main(void){ char matriz[2...
asked by 05.09.2017 / 14:38