Youssof Kamal
Youssof Kamal

Reputation: 31

How to change the default code template for C++ in Eclipse?

I'm using Eclipse as an IDE for C++ programming. When creating a new project, I get the following default template:

//============================================================================
// Name        : .cpp
// Author      : "name I can specify"
// Version     :
// Copyright   : ©opyRights
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
using namespace std;

int main() {
cout << "" << endl; // prints 
return 0;
}

So, what I want to know is: How can I change this default template as a whole - the include files, the first part which contains the Name (in blank), and other information?

Thanks.

Upvotes: 3

Views: 2933

Answers (3)

BigMuzzy
BigMuzzy

Reputation: 138

You'll fine it here: Windows -> Preferences -> C/C++ -> Code Style -> Code Templates

enter image description here

Upvotes: 0

User9123
User9123

Reputation: 1

The template is probably stored in a jar file inside the Eclipse's plugin folder. You can use WinRAR to search within all the jar files. Search for a significant word, like Author :. Once found the jar file, unzip it, modify the template, re-zip it, rename it to jar. Go back to the Eclipse's plugin folder, make a backup of the old jar (rar it or 7zip it or move it from that folder) and replace it with your new jar (it must have the exact same filename).

Upvotes: 0

user6054931
user6054931

Reputation:

Templates are located in the preferences window. Here is the path:

Window > Preferences > C++ > Editor > Templates > Edit

A 'New Template' window should appear.

Upvotes: 0

Related Questions