Home > Backend Development > C++ > How to Enable C 11/C 0x Support in Dev-C for Range-Based For Loops?

How to Enable C 11/C 0x Support in Dev-C for Range-Based For Loops?

Barbara Streisand
Release: 2024-12-04 03:21:10
Original
387 people have browsed it

How to Enable C  11/C  0x Support in Dev-C   for Range-Based For Loops?

How to Enable C 0x in Dev-C for Range-Based for Loops

Dev-C 's default compilation mode, C 98, does not support modern C features like range-based for loops. To utilize these features, you must switch the compiler to a mode that supports C 0x.

Changing Compilation Mode

Locate the "Tools" menu in Dev-C and select "Compiler Options". In the pop-up window, navigate to the "Compiler" tab.

Enable the checkbox labeled "Add the following commands when calling the compiler". In the text entry field below, enter either "-std=c 11" or "-std=C 0x".

Error Resolution

The error message "[Error] range-based-for loops are not allowed in C 98 mode" indicates that the compiler is still running in C 98 mode. Ensure that you have followed the steps above and restarted the IDE if necessary.

After making these changes, Dev-C should compile your code with support for range-based for loops and other C 0x features.

The above is the detailed content of How to Enable C 11/C 0x Support in Dev-C for Range-Based For Loops?. 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
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template