Questions tagged as 'c'

1
answer

Array parameter passing error

I'm trying to understand how pointers work for an array. For this, I elaborated the small program below. I made some mistake because, in the line indicated, segmentation fault is occurring. What is the correct way to pass the pointer pointi...
asked by 14.12.2014 / 17:26
3
answers

What is the purpose of returning the main function and the importance of this function?

I would like to know what is the importance of the function main and what is the purpose of the return of it that is an integer? Here is a minimal example of the implementation of the main function: int main() { printf("St...
asked by 21.04.2016 / 03:40
3
answers

Algorithm language C - Multiplication

   Translate into the C language: Take a number from the keyboard and repeat the operation by multiplying it by three (by printing the new value) until it is greater than 100. Eg if the user types 5, screen the following sequence: 5 15 45 135....
asked by 09.06.2014 / 22:33
1
answer

Is it good to use global variables for greater readability in code?

I am implementing an exercise in the Deitel book, How to Program C, 6th edition, the Logo problem in Chapter 6. It was an interesting question with legal logical problems etc. The only doubt of implementation may seem very primary, but it really...
asked by 11.02.2015 / 19:52
1
answer

When should I use the "?" operator in C?

When should I use the ternary operator ? in C? #include <stdio.h> int main(void) { int valor, resultado; printf("\nValor: "); scanf("%d", &valor); resultado = valor < 10 ? 50 : 0; printf("\nResultado...
asked by 13.10.2015 / 19:20
1
answer

What is unrolling?

In this question I asked about the optimization and performance that the compiler performs. Among the highlighted items, users commented that the compiler does an unrolling loop optimization or unrolling . What is this unrolling ?...
asked by 23.02.2017 / 14:33
2
answers

Is there a C interpreter?

Everyone knows that C is a compiled language. Some know that in theory any language can be interpreted, unless it has some specification to prevent. Are there C interpreters? Do they serve for anything? And C ++?     
asked by 25.01.2017 / 11:52
1
answer

What is the comma for?

The comma is what? Just a construction of language? An operator? Why does it exist? This question is based on what you saw in Returning or extracting more than one value from a function? . return base2, base3, base4     
asked by 06.01.2017 / 12:08
1
answer

Change vertices of a plane by rotating

I have a plan on the screen and I want to rotate it by 5 degrees, without using glRotate , I have the code: #include <GL/glut.h> #include <math.h> #include <stdio.h> #define HEIGHT 500 #define WIDTH 500 #define POINTS...
asked by 26.11.2016 / 23:37
1
answer

What are the characteristics of structured programming?

I would like to know what are the characteristics that defines the paradigm of structured programming , and what is the difference of this paradigm with the paradigm of procedural programming ? Both for me it seems the same, and does not chang...
asked by 09.04.2016 / 04:38