Click here to Skip to main content
15,904,500 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: hi i m working in asp.net Pin
Mark Salsbery31-Jul-07 8:07
Mark Salsbery31-Jul-07 8:07 
QuestionRe: hi i m working in asp.net Pin
Hamid_RT31-Jul-07 21:18
Hamid_RT31-Jul-07 21:18 
Questionhow to import data to tally from xml? Pin
munna_vannan30-Jul-07 20:53
munna_vannan30-Jul-07 20:53 
QuestionMember Function Template Pin
Andy Rama30-Jul-07 20:42
Andy Rama30-Jul-07 20:42 
AnswerRe: Member Function Template [modified] Pin
Nelek30-Jul-07 20:54
protectorNelek30-Jul-07 20:54 
GeneralRe: Member Function Template Pin
Andy Rama30-Jul-07 21:00
Andy Rama30-Jul-07 21:00 
GeneralRe: Member Function Template Pin
Andy Rama30-Jul-07 21:09
Andy Rama30-Jul-07 21:09 
GeneralRe: Member Function Template Pin
Andy Rama30-Jul-07 21:22
Andy Rama30-Jul-07 21:22 
As you have written member function as inline, i change code as following,
<br />
class CProg<br />
{<br />
	int val;<br />
public :<br />
	void SetVal(int y);<br />
	template<class T><br />
	void AddValues(T a, T b)<br />
	{<br />
	T x = a+b;<br />
	}<br />
};<br />
void CProg::SetVal(int y)<br />
{<br />
	val = y;<br />
}<br />
<br />
int main(int argc, char* argv[])<br />
{<br />
	CProg prog;<br />
	prog.SetVal(9);<br />
	int a,b;<br />
	a = b =8;<br />
	prog.AddValues(a,b);<br />
	double x, y<br />
	x = 12.1212;<br />
        y = 12.446;<br />
	prog.AddValues(x,y);<br />
	return 0;<br />
}

Above code is working properly. Thanks for that.

But eventhough, is there any other way for non-inline memeber function for class to use as Function Template ?
GeneralRe: Member Function Template Pin
Nelek30-Jul-07 21:39
protectorNelek30-Jul-07 21:39 
GeneralRe: Member Function Template Pin
jhwurmbach30-Jul-07 22:10
jhwurmbach30-Jul-07 22:10 
GeneralRe: Member Function Template Pin
Nelek30-Jul-07 23:56
protectorNelek30-Jul-07 23:56 
AnswerRe: Member Function Template Pin
Nelek30-Jul-07 21:12
protectorNelek30-Jul-07 21:12 
QuestionCString accumulation Pin
tom groezer30-Jul-07 20:40
tom groezer30-Jul-07 20:40 
AnswerRe: CString accumulation Pin
Rage30-Jul-07 20:59
professionalRage30-Jul-07 20:59 
AnswerRe: CString accumulation Pin
Joe Smith IX30-Jul-07 21:19
Joe Smith IX30-Jul-07 21:19 
QuestionRegarding Interview Pin
tasumisra30-Jul-07 20:26
tasumisra30-Jul-07 20:26 
AnswerRe: Regarding Interview Pin
mandanani30-Jul-07 20:31
mandanani30-Jul-07 20:31 
GeneralRe: Regarding Interview Pin
Nelek30-Jul-07 21:42
protectorNelek30-Jul-07 21:42 
AnswerRe: Regarding Interview Pin
David Crow31-Jul-07 2:55
David Crow31-Jul-07 2:55 
QuestionGDI Object count Pin
Nishad S30-Jul-07 20:11
Nishad S30-Jul-07 20:11 
AnswerRe: GDI Object count Pin
mandanani30-Jul-07 20:30
mandanani30-Jul-07 20:30 
GeneralRe: GDI Object count Pin
Nishad S30-Jul-07 20:57
Nishad S30-Jul-07 20:57 
QuestionOpenFile Pin
nitin330-Jul-07 19:12
nitin330-Jul-07 19:12 
AnswerRe: OpenFile Pin
prasad_som30-Jul-07 19:21
prasad_som30-Jul-07 19:21 
QuestionRe: OpenFile Pin
nitin330-Jul-07 19:57
nitin330-Jul-07 19:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.