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...
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...
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...
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...
#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...
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?
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...
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...