Questions tagged as 'c'

1
answer

Pointer and Memory Allocation

I know which pointer stores memory address. And a variable stores a value. But taking into account that I have a class class player {} and I create a variable player p; and a pointer instance player *np = null; What's the di...
asked by 09.04.2018 / 03:50
1
answer

Error in the conversion of numerical bases

Well I'm making the question 1199 Conversion of uri bases but in some cases my test passed, but when I put a number that the staff put in the forum gave error, the number was 0x80000000 the expected result is 2147483648, except that my code pr...
asked by 29.03.2018 / 15:14
1
answer

Function operation fork ()

Someone can explain how the fork () function works relative to the state of the variables for each child process call in this piece of code: #include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <unistd.h&...
asked by 18.04.2018 / 19:59
1
answer

I want to make a decimal to binary converter without using itoa () or vectors in C

My code works to a certain extent. When I supply values above 1023 to num, the program goes wrong, below 1023 the program works perfectly. Does anyone know what it can be? #include <stdio.h> #include <stdlib.h> int main() { in...
asked by 20.03.2018 / 21:59
2
answers

Function that returns vector

How to return a vector inside a function? And what do I call it in the main? This return in case: (return vector;) #include <conio.h> #include <stdio.h> #include <stdlib.h> float UK (int mat[4][4], float w[3]){ float *vet...
asked by 22.04.2018 / 00:19
2
answers

Does anyone help me with this?

5) Make a program that receives the base salary of an employee, calculate and show your salary to receive, knowing that the employee has a bonus of $ 50 and pays 10% tax #include <stdio.h> int main() { float sal,imposto,s_final; printf(...
asked by 19.03.2018 / 22:40
2
answers

Assigning values to a variable

I have the following program: #include <stdio.h> int a,b; int main(int argc,char *argv[]){ int c; printf("%d",a+b); printf("%d",c); return 0; } How do I pass a value to the global or local variable via terminal? When I...
asked by 11.04.2018 / 20:28
1
answer

How to pass values via terminal to a program function

#include <stdio.h> #include <string.h> void soma(int a,int b); int main(int argc,char *argv[]) { printf("A soma="); return 0; } void soma(int a,int b){ printf("%d\n",a+b); } How do I pass the values via terminal to the...
asked by 11.04.2018 / 21:57
1
answer

Help in C Algorithm activity

Does anyone know what I'm doing wrong in my code?    1) Make a program that determines the chronologically greater date between two dates provided by the user. Each date must be composed of three integer values, where the first represents the...
asked by 31.03.2018 / 20:16
1
answer

Doubt in C code!

Someone could help me with this issue from my exercise list: Make a program that receives a real number, find and show: a) the whole part of that number; b) the fractional part of that number; c) the rounding of that number. I do n...
asked by 22.03.2018 / 23:36