Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.

Search the Tips
Tip Bank > C++ > Compilers

Compilers - Page 2

21-40 of 71     Previous     Next
The #error Preprocessor Directive
by Danny Kalev
During the preprocessing phase, you can report errors by using the #error preprocessor directive. For example, suppose you have a program that uses 64-bit integers. This program has to be ported ...
Sizeof Structure as Defined, Not Allocated
by DevX Pro
Given: pre> typedef struct { byte a; byte b; byte c; byte d; byte e; } LETTERS; sizeof(LETTERS) returns eight bytes because of padding by the compiler for alignment. How can I determine how many bytes were actually defined, not allocated?
Keyword 'huge'
by DevX Pro
I am getting a compile error 'huge' obsolete keyword. I am converting a process from Visual C++ 2.0 to 6.0. What keyword could I use in place of 'huge'?
What You Can Learn from Compiler Warnings
by Danny Kalev
The following code has a subtle bug. Can you detect ...
Compiler for BOOL in C++
by DevX Pro
Can you please name a few compilers that implement bool?
How to Reduce Compilation Time
by Danny Kalev
Most compilers nowadays have several options that reduce compilation time considerably. These options include incremental build, precompiled header files, and cached header files. By default, these ...
Error 2374 for loop-scoped variable declaration
by DevX Pro
The following code produces an error when compiled on Microsoft Visual C++ 6 SP3: for (int i = 0; i error C2374: 'i' : redefinition; multiple initialization But it compiles cleanly on gcc. Why? Which interpretation of the language specification is correct?
Private Member as Return Type?
by DevX Pro
I was trying to test a base class and I came across an unusual question: in the below code, why doesn't the compiler complain about the return code type being a private member? class TestCompile { private: enum action { encrypt, decrypt }; public: action getAction(){return encrypt;} }; I believe it should complain, or at least warn the developer of the situation. I am using HPUX and aCC.
Take Advantage of Open Source Products
by Danny Kalev
Open source products come with their source code files. Although you can usually install a ready-made executable file, you want to take advantage of the available source code files and compile them ...
Porting Code to a Different Compiler
by Danny Kalev
I receive many questions from readers asking for guidance on how to port an existing C++ app to a different compiler or platform. Porting software can be very easy or very difficult, depending on ...
Returning Data Structures from Functions
by DevX Pro
I'm working with a CCS compiler for the PIC16F877, so the rules may be different, but I've created my own data structure (named MERIT_long) to support >16bit values (CCS's largest data-type is a 16bit long); it has an 8bit char(MSB) and a 16bit long(LSB), as well as a 1bit short (rollover flag). I need to return this struct from a function, but the compiler complains. Do I need to use pointers/references for this? If so, how? I assume this is part of regular C/C++ functionality, and possibly a limitation of the CCS compiler.
A C++ Virtual Machine?
by Danny Kalev
It was a question of time until a C++ virtual machine would appear. Implementing a Java-style virtual machine for C++ is a trivial task. The problem is that such a virtual machine would suffer from ...
The "Maximal Munch" Principle
by Danny Kalev
Every compiler has a tokenizer, which is a component that parses a source file into distinct tokens (keywords, operators, identifiers etc.). One of the tokenizer's rules is called "maximal ...
Protected Inheritance Bug
by DevX Pro
What is the standard rule on access specifiers associated with superclasses? Old C++ compilers would not allow protected superclasses. But, the book I've read about OOAD allows it. Example: class a {}; class b: protected a {}; // invalid on // old c++ // compilers!
Possibility of Decompiling an EXE File?
by DevX Pro
How can I get the source code from EXE files? Does it matter if they are read-only?
Changing a DOS Program to a Win32 App
by DevX Pro
I've writen a program that simulates a heat circulation, and one of its functions performs an optimization process which uses a lot of dynamic memory. My question is, can I use this function exactly in a Windows application, or must I change it? I forgot to mention that I used malloc and.. NOT new and...
Dead Code
by DevX Pro
Do you know of a tool that helps to either eliminate or identify dead code?
Linking a *.c with a *.h File
by DevX Pro
As a developer new to C (I'm using Borland C/C++ version 5), I am trying to understand the method of linking *.c and *.h files within an application. First I wrote the one.h file. Next, I wrote the one.c file and placed the #include "one.h" statement in its declarations section. Using the Borland IDE, how do you link the files so that they can be compiled as one application?
Bringing Up the C Compiler in Visual C++ 5.0
by DevX Pro
I am a newbie to C++ and I need to know how to bring up the C compiler in MS Visual C++ 5.0? I am studing C and I own C++ 5.0 Enterprise Edition.
Ambiguous Operator Error
by DevX Pro
My small program (see below) below compiles and runs correctly on one machine and generates the following error on another: 'operator Both computers are running Windows NT 4 Service Pack 4, Microsoft Visual Studio C++ v.6. Could you please tell me where the source of this problem could be? Tools | Options | Directories Tab and Tools | Options | Help System Tab of MS Visual C++ Studio have the same settings on both computers. */ #include #include #include using namespace std; class Event{ friend ostream &operator pq; pq.push(e1); pq.push(e2); while(!pq.empty()) { cout error C2248: 'eT' : cannot access private member declared in class 'Event' see declaration of 'eT' error C2248: 'pT' : cannot access private member declared in class 'Event'
21-40 of 71     Previous     Next
We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.
Thanks for your registration, follow us on our social networks to keep up-to-date