Questions tagged as 'c'

1
answer

How to set a pointer as default parameter in C ++?

I'm "programming in C" but compiling using the .cpp extension and g ++ to have some facilities. My goal is to do a program that receives a starting salary and calculates the final salary according to a certain bonus. The bonus is given in...
asked by 21.08.2018 / 03:15
1
answer

Handling batteries in C

I am a beginner in C and have the following exercise:    The Park Parking Here contains a single lane that holds up to   ten cars. There is only one entrance / exit in the parking lot,   end of the mall. If a customer arrives to pick up a car...
asked by 04.09.2015 / 19:16
1
answer

Calculate lexicographically letter of a string

My function needs to lexicographically calculate the value of the characters (by the ASCII table) of the string. For example:    "Alibaba" and "Came" 'A' = 65 and 'V' = 86 65 - 86 = -21. Then the function would return l1 and if it...
asked by 15.06.2018 / 20:49
1
answer

I am in doubt how to do [closed]

As per module in some mathematical function in C? I tried some basic things but it did not work.     
asked by 22.09.2015 / 16:17
1
answer

Assign pointer to the array inside a function

I'm trying to write a function that assigns an integer or list of integers to a pointer, depending on a parameter. But the assignment does not work inside it, just outside: void retorna_algo(int size, int* destino){ if (size == 1){ *dest...
asked by 11.02.2018 / 07:10
1
answer

Error undefined reference to std

#include <iostream> using namespace std; int main() { int nombre, carre ; cout << "Introduza un numero : " ; cin >> nombre ; carre = nombre * nombre ; cout << "A raiz quadrada est ; " << carre ; } When c...
asked by 24.02.2017 / 11:49
2
answers

If array is the same as pointer, why does one need to be copied to one variable and another need not?

In this answer bigown said that if the frame member was a pointer you do not need to copy the string into it. But arrays are not pointers? Why is it different?     
asked by 02.02.2017 / 12:35
2
answers

Doubling bit shift in C

My question is regarding the following snippet of code: #include <stdio.h> int main(void){ int teste = 0, x0 = 0, x1 = 0, x2; x2 = 1; teste = ((x0|x2) | (x1|x2) << 1); printf("Valor de teste: %d ", tes...
asked by 29.04.2017 / 01:44
1
answer

Can you use C ++ and C # using C programming?

If I put a code for a sotfware and this code wants to use the C, C ++ and C # languages, could it? Even if I use a compiler that reads all three?     
asked by 02.12.2016 / 14:51
1
answer

Error in program C, store in vector;

Good evening, I'm doing a C program that should read 20 entries with interviewed data. I was able to work everything out, but in the matter of reading this data I'm having a strange error ... (It could be Turbo C thing) ... In short, I can...
asked by 13.07.2016 / 04:26