3 Effective Ways to Copy Paste in Turbo C++

Turbo C++ is an integrated development environment (IDE) and compiler for the C and C++ programming languages, originally developed by Borland in the early 1990s. It was widely used for educational purposes and basic application development during that time. The environment is based on DOS and provides a simple text-based interface.

It’s considered a legacy compiler and dates back quite a while. It was originally designed for a platform-independent UNIX-like environment, meaning it wasn’t tied to any specific operating system. However, this also means that running Turbo C++ on modern operating systems like Windows or Linux can be a frustrating experience, as it lacks compatibility with many of the features those systems offer today.

Modern developers typically prefer IDEs such as Eclipse, Visual Studio, or Dev-C++—all of which are much more user-friendly and come equipped with advanced features and capabilities that Turbo C++ simply doesn’t support.

That said, if you still want to use Turbo C++, you’re free to do so. Just be aware that one common issue users face is the inability to copy and paste code directly within the Turbo C++ interface. Strange, right?

On Windows, we’re used to the convenience of shortcuts like Ctrl + C and Ctrl + V for copying and pasting text. These shortcuts work seamlessly in virtually all modern IDEs. Unfortunately, because Turbo C++ is so outdated, it doesn’t support these native Windows functionalities.

So, does that mean copying and pasting in Turbo C++ is impossible?

Not quite. There are workarounds that allow you to copy and paste code in Turbo C++. In the following sections, we’ll explore three different methods you can use to achieve this.

Copying code externally and importing it into Turbo C++

1. Create a new file

Launch Turbo C++, then navigate to the File menu and click on the New option to open a blank file for your code.

Create New File in turbo C++

Now that the file is created, head back to the File menu and hit Save.

Save File in Turbo C++

Enter a name for your file and click OK.
By default, Turbo C++ saves files in the BIN folder located within its installation directory.
Once done, you can close Turbo C++.

2. Copy the code and paste it into the source file.

Navigate to the BIN folder in the Turbo C++ installation directory, select the file, right-click on it, and choose to open it with Notepad++ or any other text editor of your choice.

Use the standard Windows functions Ctrl + C and Ctrl + V to copy and paste the required code into the file, then save it.

Source Code File in Turbo C++

3. Open the modified file in Turbo C++

Restart the Turbo C++ application. Select File menu and click Open or press F3

File Open in Turbo C+

Select the modified file and click on Open.

Open file in turbo c++
Copy paste code in turbo c++

This allows you to edit the file outside of Turbo C++ and paste the required code into it. While the process might seem a bit complicated at first, it’s much easier than rewriting a long piece of code from scratch.

Use Turbo C++ menu options to copy paste the code

If you have previously written code in a different file and now wish to use that entire code or a portion of it in your current project, Turbo C++ provides a way to do this easily. Instead of retyping the code manually, you can simply copy the desired section from the original file and paste it into your current file within Turbo C++ by following the steps outlined below.

  • Open the file that contains the code you want to copy.
  • Highlight or select the portion of the code you want to reuse.
  • Go to the Edit menu and click on Copy.
  • Open the file where you want to paste the copied code.
  • Again, go to the Edit menu and click on Paste.
Copy paste menu options in Turbo c++

By following these steps, you can easily copy and paste code between files within Turbo C++ using its menu options, saving time and effort—especially when dealing with larger code snippets.

Using Keyboard Shortcuts to Copy Paste in Turbo C++

While working in Turbo C++, you might notice that the usual Windows shortcut Ctrl + C for copy and Ctrl + V for paste do not function as expected. Turbo C++ uses its own set of keyboard shortcuts for these actions. If you prefer using the keyboard instead of the menu options, you can follow the steps below to copy and paste code efficiently:

  1. First, open both the source file (the file containing the code you want to copy) and the destination file (where you want to paste the code) in Turbo C++.
  2. In the source file, use your mouse to select or highlight the block of code you want to copy.
  3. Once the code is selected, press Ctrl + Ins on your keyboard to copy the selected code to the clipboard.
  4. Switch to the destination file by selecting it from the Turbo C++ file menu or window tabs.
  5. Position the cursor where you want the code to be inserted, then press Shift + Ins to paste the copied code.

Important Note: These Turbo C++ keyboard shortcuts Ctrl + Ins (copy) and Shift + Ins (paste) only work when both the source and destination files are open within the Turbo C++ environment. If the file you want to copy from is located outside of Turbo C++, such as on your desktop or in another text editor, these shortcuts will not work.

In such cases, you’ll need to use the method involving Turbo C++’s Edit menu, as described earlier. That approach allows you to paste code copied from external files into the Turbo C++ editor more reliably

Summary:

It’s quite uncommon to encounter situations where the standard Windows copy-paste shortcuts don’t work, but Turbo C++ is one of those exceptions. Fortunately, there are alternative methods and workarounds to get the job done. We hope this guide has helped you understand how to copy paste in Turbo C++. If you found this helpful or have your own tips to share, feel free to leave a comment with your experience. Or you can reach out to us using contact form.

Leave a Comment