Skip to main content



      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 17:05 Go to next message
Eclipse UserFriend
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 17:06] by Moderator

Re: Is it possible to auto generate a source or header file? [message #1806254 is a reply to message #1806249] Mon, 06 May 2019 23:41 Go to previous messageGo to next message
Eclipse UserFriend
It's best to ask questions about the C/C++ tools using the CDT forum: https://www.eclipse.org/forums/eclipse.tools.cdt

Re: Is it possible to auto generate a source or header file? [message #1806724 is a reply to message #1806254] Tue, 14 May 2019 08:28 Go to previous message
Eclipse UserFriend
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: Wed Jul 23 21:28:02 EDT 2025

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

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

Back to the top