Home > Backend Development > C++ > How to Enable C 0x Support in Dev-C ?

How to Enable C 0x Support in Dev-C ?

DDD
Release: 2024-12-04 10:09:12
Original
415 people have browsed it

How to Enable C  0x Support in Dev-C  ?

Changing Dev-C Mode to Support C 0x

Users learning range-based for loops in Dev-C may encounter the error "range-based-for loops are not allowed in C 98 mode." This indicates that the default mode in Dev-C is C 98, which does not support this feature and other aspects of C 0x.

To rectify this issue and enable support for C 0x features:

1. Access Compiler Options:
Navigate to "Tools -> Compiler Options" and select the "Compiler" tab.

2. Enable Custom Compiler Commands:
Check the checkbox labeled "Add the following commands when calling the compiler."

3. Specify C 0x Standard:
In the text entry box, enter either "-std=c 11" or "-std=C 0x" to specify the desired C 0x standard.

For example, if using Dev C version 5.3.0.3 with TDM-GCC 4.6.1 64 bit, the settings should appear as follows:

  • Compiler Options Panel:

    • Tab: Compiler
    • Checkbox: "Add the following commands when calling the compiler"
    • Text Entry Box: "-std=c 11" or "-std=C 0x"

These changes will alter the compiler behavior to support C 0x features, including range-based for loops.

The above is the detailed content of How to Enable C 0x Support in Dev-C ?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template