Which one is update software for c++ and c language.
Some practice center such as Codechef,, Uva online judge , I submit a right code but they said the code has compiling error such as it does not familiar with conio.h,getch() etc.
I use Dev c++.
How can I solve this problem.
Please help.

Dani AI

Generated

— the replies from , and point in the right direction: the quickest fix is to make your programs use only portable, standard C/C++ facilities and to compile locally with a toolchain similar to the online judge. Below are concrete, immediately applicable steps and checks.

Replace nonportable console tricks with standard I/O. For example, instead of using platform-specific pause/read routines, read one character with standard calls:

#include <iostream>

int main() {
    // program logic here
    std::cout << "Done\n";
    std::cin.get();   // portable way to wait for a key / enter
    return 0;
}

Compile with a modern GCC/Clang toolchain and the language standard the judge expects. A common local command is:

g++ -std=c++17 -O2 -Wall -pipe solution.cpp -o solution

On Windows, use MinGW-w64 or the Windows Subsystem for Linux (WSL) so your local compiler behaves like the Linux-based judge compilers. Official pages: MinGW-w64 (https://mingw-w64.org/) and WSL docs (https://learn.microsoft.com/windows/wsl/). For language reference and portable functions, see the C++ reference (https://en.cppreference.com/).

Quick checklist before submitting to CodeChef/UVa/etc.:

  • Remove any platform-specific headers or calls and any console prompts.
  • Match the judge's required C/C++ standard (C++11/C++14/C++17).
  • Test with input files (no interactive prompts) and large inputs if needed.
  • Use fast I/O idioms (for C++: ios::sync_with_stdio(false); cin.tie(nullptr);) when solving problems with heavy I/O.

These steps let local testing mirror the judge environment and prevent the common compile/runtime mismatches.

Recommended Answers

All 3 Replies

I use Dev c++.
How can I solve this problem.

Stop using Dev-C++.

conio.h is not standard C++ and there is no guarantee that other compilers come with it, and no guarantee that if they do, the functions work the same way.

Dev-C++ uses an old compiler with known problems. Use a more modern compiler that conforms to the C++ standard. For example, wxDev-C++ or the free express version of Microsoft Visual C++.

Your code may be right but it is only right in a certain compilers or a specific one. If u need a library perhaps for one compiler, it does not necessarily mean you will need it for another.

I recommend you to use Express Edition (Free) of Microsoft Visual Studio if you want to be really a programmer. You can find the VS from Microsoft site.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.