Questions tagged as 'gcc'

1
answer

Access null pointer is not generating error

Testing the code below, I noticed strange behavior. It is working when it should not. The correct thing, in my view, was to give a segmentation fault and abort, but it looks like the compiler is doing some magic to fix the code. What happens?...
asked by 09.08.2016 / 17:37
1
answer

GCC compiler command to display #ifdef

What compiler command do I use to display this line at runtime? #ifdef DEBUG double tInicio_=clock() ; #endif     
asked by 02.07.2016 / 22:51
1
answer

Difference between GCC CLang

Unix-based systems (a large majority) usually use GCC , to compile the files in C , but also have the CLang for the same purpose.    Is there a difference in compiling a project using GCC and CLang ?     
asked by 26.07.2016 / 03:23
3
answers

Compiler reports error when I try to zero vector

The compilers accuse error when I try to zero a vector with the command vetor[10] = {0}; And it only accuses error in this line because I also used it in the int vetor[10] = {0} attribution and there does not acknowledge error....
asked by 24.03.2015 / 21:15
3
answers

Error in variable declaration in loop

I made the following command: for(int i = 1 ; i <= 3 ; i++) {etc } So I gave the following error when I compiled: game.c:11:2: error: "for" loop initial declarations are only allowed in C99 mode for(int i = 1 ; i <= 3 ; i++) { /\ //...
asked by 18.09.2015 / 01:14
1
answer

Compiling code in Ubuntu and running on windows

Hello, I was wondering how can I compile a C code in Ubuntu and that run in Windows. I tried to put the extension ".exe" at the end of the file, but when I sent the executable to my teacher he said which did not rotate.     
asked by 18.06.2017 / 20:10
1
answer

Is there a difference between GCC C ++ and Visual Studio C ++?

I have already programmed in C ++ compiling with GCC and when I started using Visual Studio I noticed that it has support for C ++, however the implementation is geared towards the .Net platform. Is there a difference between these two versio...
asked by 02.08.2016 / 07:50
1
answer

"Output" with special characters

I'm using the GCC version 5.3 compiler for the following program, written in Aptana: #include <stdio.h> void main(void) { int positivo = 32767; int negativo = -32768; printf("%d +1 é %d\n", positivo, positivo+1); printf...
asked by 05.12.2016 / 23:51
1
answer

How to vectorize code in C ++?

I would like to know how to vectorize code in C ++? because the material I found on the internet is a bit fake about it. I understand as a vectorization the use not only of vectors, but of doing in a single step a whole sequence of steps, tha...
asked by 21.09.2017 / 20:15
1
answer

C ++: Adding ".cpp" implementations in Visual Studio and GCC

In C ++, what you observe in a quick internet search is the guideline that only ".h" files should be included. A sample of this can be seen here and especially here . In Visual Studio, adding only ".h" with #include ... is not a pr...
asked by 05.10.2017 / 03:43