|
you are sooo lazy!
If you don't want to learn how to program then take a different course, if you do want to learn then try to learn it by having a go yourself first.
Darka [Xanya]
|
|
|
|
|
Or he could cheat like someone with integrity and *pay* to have his homework done for him
earl
|
|
|
|
|
|
earl wrote: Or he could cheat like someone with integrity...
How can you cheat and have integrity? They are mutually exclusive things.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Eh, mostly being sarcastic, but if the OP wants someone to do his (her?) work for him/her, the least he or she can do is pay someone...
earl
|
|
|
|
|
Hi All,
If I'm instantiating a template class with 5 different objects, how many function signatures will be there in the memory?
My assumption is that, there will be 5 different signature since the object type are different. it so sad that, we can't debug a template class
for e.g. see the pseudo code below
template<class T> class MyTemplate
{
public:
void Fxn(T inputval)
{
printf("Function called %d",inputval);
}
};
int main()
{
MyTemplate<int> objint;
objint.Fxn(10);
MyTemplate<float> objfloat;
objfloat.Fxn(15.0f);
MyTemplate<short> objshort;
objshort.Fxn(20);
MyTemplate<double> objdouble;
objdouble.Fxn(25.5);
MyTemplate<long> objlong;
objlong.Fxn(30);
}
SaRath.
"Where I am from, there is no plan B. So, take advantage of today becuase tomorrow is not promised. - 50 Cent"
My Blog | Understanding State Pattern
|
|
|
|
|
is ur code exceuting i feel it should be
class MyTemplate
{
public:
template <class T> void Fxn(T inputval)
{
printf("Function called %d",inputval);
}
};
never say die
-- modified at 8:14 Tuesday 18th July, 2006
|
|
|
|
|
sunit5 wrote: is ur code exceuting i feel it should be
class MyTemplate
{
public:
template <class t=""> void Fxn(T inputval)
Good Reply
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
sunit5 wrote: is ur code exceuting i feel it should be
class MyTemplate
{
public:
template <class t=""> void Fxn(T inputval)
Good Reply , but!!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
sunit5 wrote: is ur code exceuting i feel it should be
class MyTemplate
{
public:
template <class t=""> void Fxn(T inputval)
{
printf("Function called %d",inputval);
}
};
I meant it is not easy to get the function address that's what I said. Nice Joke ;P
SaRath.
"Where I am from, there is no plan B. So, take advantage of today becuase tomorrow is not promised. - 50 Cent"
My Blog | Understanding State Patte
|
|
|
|
|
Anyway I have added one more statement in my "Fxn" function which prints the address.
printf("Function Address%x\n",Fxn);
I'm not sure whether it is correct or not but the output is like this
<br />
Function Address401000<br />
Function called 10<br />
Function Address401030<br />
Function called 0<br />
Function Address401060<br />
Function called 20<br />
Function Address401090<br />
Function called 0<br />
Function Address4010c0<br />
Function called 30Press
I have added one more object of type int, like this
MyTemplate<int> objint;
objint.Fxn(10);
MyTemplate<int> objint1;
objint1.Fxn(100);
it prints same value as the function address
So as per the above code & results it seems that, there are different function signatures
SaRath.
"Where I am from, there is no plan B. So, take advantage of today becuase tomorrow is not promised. - 50 Cent"
My Blog | Understanding State Patte
-- modified at 9:23 Tuesday 18th July, 2006
|
|
|
|
|
I want to make file that has the name are "day,month,year and time".
What's function can return these data ?
|
|
|
|
|
|
Max++ wrote: What's function can return these data ?
Most of these.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Max++ wrote: What's function can return these data ?
COleDateTime,SYSTEMTIME
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
|
Take a look at the atoi[^] and itoa[^] functions.
First, retrieve the text in the edit controls (with GetWindowText), transform it into an int with atoi, add them together and convert the result into a string with itoa. Then display it in the other edit control with SetWindowText.
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
how to set base as i want values but it gives in 2,3,4,5... base
as 1+1 =2 but it gives value according to base
Ashish Dogra
MCA
Noida
|
|
|
|
|
See
<br />
int a,b;<br />
a=GetDlgItemInt(IDC_EDIT1);<br />
b=GetDlgItemInt(IDC_EDIT2);<br />
SetDlgItemInt(IDC_EDIT3,a+b);<br />
whitesky
|
|
|
|
|
ashish dogra wrote: we take two values from two edit controls and then add in to third edit control
In MFC:-
SetDlgItemInt(THIRDCONTROLID,GetDlgItemInt(FirstControlID)+GetDlgItemInt(SecondControlId));
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Hi
I have an edit control, when the user types in a full stop, i automatically
want to put a space after it
what would be the best way to go about this
thanks
si
|
|
|
|
|
You can overwrite the WM_CHAR message to accomplish this. It should do the trick you need. Good luck!
|
|
|
|
|
To override WM_CHAR he should have a separate class derived from CEdit.
Dream bigger... Do bigger...Expect smaller
aji
|
|
|
|
|
Not to. Personally, I hate it when a program decides to add stuff to what I'm typing. If I want a space after a full stop, I type one. Period.
However, if you must, handle WM_CHAR. For the case where the character is a full stop, add a space. (MFC use OnChar in a derived CEdit class)
But beware. If the user has selected text, and replaces it with a full stop, would you want to append a space in that case too, or only if there wasn't already one?
Steve S
Developer for hire
|
|
|
|
|
Add control variable for the edit control
CEdit m_Edit;
Override EN_UPDATE
Then
void OnUpdateEdit3()
{
CString csText;
m_Edit.GetWindowText( csText );
csText = csText.Right(1);
// Here you can compare csText with dot. and can add space here
}
Dream bigger... Do bigger...Expect smaller
aji
|
|
|
|