Reply

R

Ramesh

Hello,
U could declare a class instead of the function and it can have data
members as that of the arguments u pass to the function u've
specified.And those data members are private while this function is
public .Its constructor will take those arguments which were taken by
your function.

Example:
class Recur{
private:
double a;
double b;
double res;
public :
Recur(double a1,double b1){
a=a1;b=b1;
}

double recur_func(){
Recur x1( a+b/2 , b+a/2 ),//Does something
x2( a*b/(a+b) , 2*a*b/(a+b) );
res = x1.recur_func() + x2.recur_func();
return res;
}
};


in main

main()
{
Recur s(21.0,51.0);
cout<<s.recur_func();
}


I think that'll do....
Bye..
 
J

Jens.Toerring

Ramesh, could you be so kind to post your reply in the thread the
question was asked in? Starting a new thread with a different
(and rather meaningless) title makes it extremely hard to figure
out what you are replying to.
U could declare a class instead of the function and it can have data
members as that of the arguments u pass to the function u've
specified.And those data members are private while this function is
public .Its constructor will take those arguments which were taken by
your function.

Stop right here. That's C++. We do C here, which is a different
language and doesn't has classes.

BTW, what you write as 'u' is normally written as 'you' in English.
If you could stick to the conventional way of spelling it would make
your posts quite a bit easier to read for people like me whose first
language isn't English.
Regards, Jens
 
C

CBFalconer

Ramesh said:
U could declare a class instead of the function and it can have data
members as that of the arguments u pass to the function u've
specified.And those data members are private while this function is
public .Its constructor will take those arguments which were taken by
your function.

You have several glaring mistakes here. First, C has no classes,
nor private nor public functions. Neither does it have
constructors. Thus you are far off-topic.

In addition you have misspelled "you", "you've", and mispunctuated
your sentences, which should have at least one blank after a
terminal '.'. This is highly annoying to the reader and makes you
appear uneducated.

Thirdly, you have failed to quote whatever you are replying to, so
nobody has the slightest idea what the problem is. I suspect you
have started a new thread in addition.
 
D

Default User

Ramesh, could you be so kind to post your reply in the thread the
question was asked in? Starting a new thread with a different
(and rather meaningless) title makes it extremely hard to figure
out what you are replying to.


He's using the braindead google posting system, where any change to the
subject starts a new thread.



Brian Rodenborn
 
J

Joe Wright

Default said:
He's using the braindead google posting system, where any change to the
subject starts a new thread.



Brian Rodenborn

Surely, a change is subject is the definition of a new thread. ?
 
A

Arthur J. O'Dwyer

Surely, a change is subject is the definition of a new thread. ?

No; Usenet threads can branch and mutate. Remember, a "thread" is
not just a subject line: it's a history of referenced posts. At the
most basic level, if a post is a reply to a previous post to the same
newsgroup, and quotes that previous post, then the two posts ought to
be considered part of the same thread regardless of subject line.

(As an example, consider this post, which will be treated as a separate
thread by Google Groups because of the added [OT] tag in the subject line,
even though it's clearly a response to your post.)

Google's threading is broken (ironically, you can use Google to find
lots and lots of posts commenting on this fact), and I don't recall ever
seeing a good explanation for why it's so broken. The References headers
are right there in the message; it's not like Google /couldn't/ link
threads together properly. They just don't want to.

HTH,
-Arthur
 
D

Default User

Joe said:
Default User wrote:
Surely, a change is subject is the definition of a new thread. ?

Not at all. Even something as simple as correcting a typo or adding
[OT] to a subject line starts a new thread in google. They also glomm
together unrelated threads that happen to have the same subject.

I appreciate the job the Google people did in rescuing the archives
when Deja was going under, but the newsreading system isn't good. I
haven't looked at their Beta system, some of these problems may be
corrected there.

All in all, I recommend getting a real newsreader and news provider.
http://news.individual.net is available for free for those with no
other news source.




Brian Rodenborn
 
J

J. J. Farrell

Joe Wright said:
Surely, a change is subject is the definition of a new thread. ?

No, the absence of a "References: " header on the posting is the
definition of a new thread.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,586
Members
45,089
Latest member
Ketologenic

Latest Threads

Top