Questions tagged as 'c'

1
answer

Parameters of the exec function

I was doing an exercise in a book and it has the following order: Looking at the parameters of the exec function: exec function It does not talk about any parameters that can be passed to tell you how many times that Exec should run....
asked by 28.02.2015 / 19:50
1
answer

Problems with programming logic [closed]

I'm doing some exercises that require calculations like factoring decomposition and even problems like "A is twice the age of B when A was B's age, if we add the age of A and B today would be 81 years old "I can not get by the calculations in the...
asked by 24.06.2014 / 15:47
2
answers

C: Use two gets () followed (player names)?

I'm trying to play a game, for this I have displayed a menu and then I used the command switch to access the options, if the user wants to play it select 1 and will be asked the name of the players 1 and 2, for this I used get but...
asked by 12.06.2015 / 05:45
1
answer

C - Concatenate char (Not STRCAT)

I have 2 variables: char x[100] and char c; At first, I needed to store c within x . I did this: x[0] = c; Within my program, after the one previously executed, the c variable changes value. So I need to...
asked by 11.06.2015 / 17:45
2
answers

"expected expression before 'int'" error

I was following this example, but it was done in Windows, so I used <conio.h> . When I try to run on Linux I get 2 errors: one in *h=int(tempo); , I do not understand why, and the other in getch . How can I replace them?...
asked by 25.03.2014 / 00:12
2
answers

Read multiple integers in the same input in C

Basically, I should insert a number that represents the number of integers to insert. Then insert the integers into each other, separated by space, in the same input. Example: 5 1 2 3 4 5 I tried to perform the following repetition,...
asked by 03.04.2014 / 22:15
2
answers

How to insert an asterisk every 3 characters?

How do I enter any value, either text or number, and an asterisk is inserted every 3 positions? Example: I type 123456789 , pressing enter will show: 123*456*789*     
asked by 18.06.2014 / 20:46
1
answer

When actually using malloc () and / or calloc ()?

My doubt is that you are learning from banal examples (as I see it), as in: int *ptr; ptr = malloc(sizeof(int)); I find it useless to allocate a space from an integer to an integer pointer, does it not do it alone anymore? When do...
asked by 04.12.2018 / 01:30
1
answer

Doubt with Pointer to Struct in C

I'm trying to solve a college exercise, where the statement asks me to receive a record, with two fields as input data. One vector field to store name and another to store enrollment. I should also declare a pointer to the heterogeneous data str...
asked by 04.12.2018 / 14:20
1
answer

You are executing the commands directly without typing the other notes

You are not typing the rest, just typing the first one is already going to the last one. #include <iostream> #include<stdio.h> int main(void) { int n1,n2,pim,rn1,rn2,rpim,rfinal; rn1=n1*4; rn2=n2*4; rpim=pim*2;...
asked by 20.11.2018 / 01:57