Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Is it possible to auto generate a source or header file?
Is it possible to auto generate a source or header file? [message #1806249] Mon, 06 May 2019 21:05 Go to next message
Robert Murch is currently offline Robert MurchFriend
Messages: 13
Registered: August 2018
Junior Member
I was wondering, lets say I build some function like:

double median(vector<double> vec)
{
	typedef vector<double>::size_type vec_sz;

	vec_sz size = vec.size();
	if(size == 0)
	{
		throw domain_error("median of an empty vector");
	}

	sort(vec.begin(), vec.end());

	vec_sz mid = size/2;

	return size % 2 == 0 ? (vec[mid] + vec[mid-1]) / 2 : vec[mid];
}


is there a method for me to auto generate a source file and a header file for this function? For instance, if I want to move this function out of the main body of the program and create a separate .cpp file for it, with it's own header file, can I just right-click the function or hit a quick key to have that happen automatically for me? If not, then lets say I already built the source file for it, can I just right-click it in there and auto generate a header for it?

[Updated on: Mon, 06 May 2019 21:06]

Report message to a moderator

Re: Is it possible to auto generate a source or header file? [message #1806254 is a reply to message #1806249] Tue, 07 May 2019 03:41 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
It's best to ask questions about the C/C++ tools using the CDT forum: https://www.eclipse.org/forums/eclipse.tools.cdt



Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Is it possible to auto generate a source or header file? [message #1806724 is a reply to message #1806254] Tue, 14 May 2019 12:28 Go to previous message
David Willson is currently offline David WillsonFriend
Messages: 1
Registered: May 2019
Junior Member
no you cannot generate a header file automatically
Previous Topic:Eclipse with ESP-IDF
Next Topic:IllegalValueException in web.xml with variable
Goto Forum:
  


Current Time: Fri Apr 19 19:15:47 GMT 2024

Powered by FUDForum. Page generated in 0.07916 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top