C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Elementfunktion 374ber zwei versch...

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ (German)
View previous topic :: View next topic  
Author Message
Jan Stumpf
Guest





PostPosted: Sun Dec 19, 2004 6:00 am    Post subject: Elementfunktion 374ber zwei versch... Reply with quote



Hallo,
Ich habe hier ein kleines Problem mit einer Aufgabenstellung für eine
Programmier-praktikumsaufgabe an einer Fachhochschule:

Es ist eine Elementfunktion der Klasse random_c vorhanden:


int random_c::getRandVal(void);

Diese soll aber ebenfalls unter dem Namen "zufall" aufrufbar sein. Die
Funktionalität ist exakt dieselbe. Fragt nicht wieso und warum das so sein
soll *g*


int random_c::zufall(void);

ist also vollkommen gleichwertig zu der oberen Elementfunktion.


Momentan haben ich das so gelöst das ich einfach den Quellcode 1:1 kopiert
habe, aber da muss es doch eine elegantere Lösung geben?
--
greetz
Jan Stumpf

--
de.comp.lang.iso-c++ - Moderation: mailto:voyager+mod (AT) bud (DOT) prima.de
FAQ: http://www.voyager.prima.de/cpp/ mailto:voyager+send-faq (AT) bud (DOT) prima.de
Back to top
Jonathan Sauer
Guest





PostPosted: Mon Dec 20, 2004 12:13 pm    Post subject: Re: Elementfunktion über zwei verschiedene Namenansprechen Reply with quote



Jan Stumpf <nbpsnewsreflector (AT) gmx (DOT) de> wrote:

Quote:
int random_c::getRandVal(void);

Diese soll aber ebenfalls unter dem Namen "zufall" aufrufbar sein. Die
Funktionalität ist exakt dieselbe. Fragt nicht wieso und warum das so sein
soll *g*


int random_c::zufall(void);

Bei der Deklaration der Funktion in der Header-Datei im Namespace
"random_c" statt der bisherigen Deklaration schreiben:

inline int zufall() { return getRandVal(); }

Dann wird nichts weiter getan als die Originalfunktion aufzurufen; durch
das Inlining kostet das auch keine Performance.

N.B: Das "void" oben ist überflüssig.


HTH, Jonathan

--
de.comp.lang.iso-c++ - Moderation: mailto:voyager+mod (AT) bud (DOT) prima.de
FAQ: http://www.voyager.prima.de/cpp/ mailto:voyager+send-faq (AT) bud (DOT) prima.de

Back to top
Rolf Magnus
Guest





PostPosted: Mon Dec 20, 2004 12:27 pm    Post subject: Re: Elementfunktion über zwei verschiedene Namen ansprechen Reply with quote



Jan Stumpf wrote:

Quote:
Hallo,
Ich habe hier ein kleines Problem mit einer Aufgabenstellung für eine
Programmier-praktikumsaufgabe an einer Fachhochschule:

Es ist eine Elementfunktion der Klasse random_c vorhanden:


int random_c::getRandVal(void);

Diese soll aber ebenfalls unter dem Namen "zufall" aufrufbar sein. Die
Funktionalität ist exakt dieselbe. Fragt nicht wieso und warum das so
sein soll *g*


int random_c::zufall(void);

ist also vollkommen gleichwertig zu der oberen Elementfunktion.


Momentan haben ich das so gelöst das ich einfach den Quellcode 1:1
kopiert habe, aber da muss es doch eine elegantere Lösung geben?

Spricht was dagegen, in zufall() einfach getRandVal() aufzurufen?

--
de.comp.lang.iso-c++ - Moderation: mailto:voyager+mod (AT) bud (DOT) prima.de
FAQ: http://www.voyager.prima.de/cpp/ mailto:voyager+send-faq (AT) bud (DOT) prima.de

Back to top
Marcel Müller
Guest





PostPosted: Mon Dec 20, 2004 12:52 pm    Post subject: Re: Elementfunktion über zwei verschiedene Namen ansprechen Reply with quote

Jan Stumpf wrote:
Quote:
int random_c::zufall(void);
[...]
ist also vollkommen gleichwertig zu der oberen Elementfunktion.

inline int random_c::zufall() { return getRandVal(); }

in den Header.


Quote:
Momentan haben ich das so gelöst das ich einfach den Quellcode 1:1 kopiert
habe, aber da muss es doch eine elegantere Lösung geben?

Definitiv ja, s.o.


Marcel

--
de.comp.lang.iso-c++ - Moderation: mailto:voyager+mod (AT) bud (DOT) prima.de
FAQ: http://www.voyager.prima.de/cpp/ mailto:voyager+send-faq (AT) bud (DOT) prima.de

Back to top
Philipp Unterbrunner
Guest





PostPosted: Thu Dec 23, 2004 1:47 am    Post subject: Re: Elementfunktion 374ber zwei versch...^ Reply with quote


"Jonathan Sauer" schrieb:
Quote:
Jan Stumpf <nbpsnewsreflector (AT) gmx (DOT) de> wrote:

int random_c::getRandVal(void);

Diese soll aber ebenfalls unter dem Namen "zufall" aufrufbar sein. Die
Funktionalität ist exakt dieselbe. Fragt nicht wieso und warum das so
sein
soll *g*


int random_c::zufall(void);

Bei der Deklaration der Funktion in der Header-Datei im Namespace
"random_c" statt der bisherigen Deklaration schreiben:

inline int zufall() { return getRandVal(); }

Wenn du keine Namespaces benutzt kannst du auch ein Makro machen:

#define zufall() getRandVal()

Die coolste Variante wäre aber zweifellos ein globales Funktionsobjekt von
dem du 2 Instanzen definierst.

class {
inline operator()() {
// your favorite code here
}
} getRandVal, zufall;

Philipp

--
de.comp.lang.iso-c++ - Moderation: mailto:voyager+mod (AT) bud (DOT) prima.de
FAQ: http://www.voyager.prima.de/cpp/ mailto:voyager+send-faq (AT) bud (DOT) prima.de

Back to top
Jonathan Sauer
Guest





PostPosted: Sat Dec 25, 2004 5:52 pm    Post subject: Re: Elementfunktion über zwei verschiedene Namen ansprechen Reply with quote

shoots
Sherry
chicken broth
oil for deep frying (1 gallon)
Salt
pepper
soy & teriyaki
minced ginger, etc.
1 tablespoon cornstarch dissolved in a little cold water
1 egg beaten

Make the stuffing:
Marinate the flesh in a mixture of soy and teriyaki sauces
then stir fry in hot oil for till brown - about 1 minute, remove.
Stir-fry the vegetables.
Put the meat back into the wok and adjust the seasoning.
De-glaze with sherry, cooking off the alcohol.
Add broth (optional) cook a few more minutes.
Add the cornstarch, cook a few minutes till thick,
then place the stuffing into a colander and cool;
2 hours
Wrap the rolls:
Place 3 tablespoons of stuffing in the wrap, roll tightly -
corner nearest you first, fold 2 side corners in,
wrap till remaining corner is left.
Brush with egg, seal, and allow to sit on the seal for
a few minutes.
Fry the rolls:
325° if using egg roll wraps, 350° for spring roll wraps.
Deep fry in peanut oil till crispy golden brown, drain on paper towels.



Lemon Neonate

Turkey serves just as well, and in fact even looks a bit like a
well-dressed baby. By the time you turn the child?s breast into
cutlets, it will be indistinguishable. The taste of young human,
although similar to turkey (and chicken) often can be wildly
different depending


Back to top
Marcel Müller
Guest





PostPosted: Sat Dec 25, 2004 5:57 pm    Post subject: Re: Elementfunktion über zwei verschiedene Namen ansprechen Reply with quote

perfection!

1 high quality limb, rack, or roast
Potatoes, carrot
Oil
celery
onions
green onions
parsley
garlic
salt, pepper, etc
2 cups beef stock

Marinate meat (optional, not necessary with better cuts).
Season liberally and lace with garlic cloves by making incisions,
and placing whole cloves deep into the meat.
Grease a baking pan, and fill with a thick bed of onions,
celery, green onions, and parsley.
Place roast on top with fat side up.
Place uncovered in 500° oven for 20 minutes, reduce oven to 325°.
Bake till medium rare (150°) and let roast rest.
Pour stock over onions and drippings, carve the meat and
place the slices in the au jus.



Bisque à l?Enfant

Honor the memory of Grandma with this dish by utilizing her good
silver soup tureen and her great grandchildren (crawfish, crab or
lobster will work just as well, however this dish is classically
made with crawfish).

Stuffed infant heads, stuffed crawfish heads, stuffed crab or lobster shells;
make patties if shell or head is not available
(such as with packaged crawfish, crab, or headless baby).
Flour
oil
onions
bell peppers
garlic salt, pepper, etc.
3 cups chicken stock
2 sticks butter
3 tablespoons oil

First stuff the heads, or make the patties (see index)
then fry or bake.
Set aside to drain on paper towels.
Make a roux with butter, oil and flour,
brown vegetables in the roux, then add chicken stock and
allow to simmer for 20 minutes.
Add the patties or stuffed heads, and some loose crawfish,
lobster, long piglet, or what have you.
Cook on low for 15 minutes, then allow it to set for at least
15 minutes more.
Serve over steamed rice; this dish is very impressive!



Stuffed Cabbage Rolls

Babies really can be found under a cabbage leaf -
or one can arrange for ground beef to be found there instead.

8 large cabbage leaves
1 lb. lean g


Back to top
Philipp Unterbrunner
Guest





PostPosted: Sat Dec 25, 2004 6:35 pm    Post subject: Re: Elementfunktion über zwei verschiedene Namen ansprechen Reply with quote

to reduce the broth.
Brown the onions, peppers and celery.
Add the meat then season, continue browning.
De-glaze with sherry, add the reduced broth.
Finally, put in the root vegetables and simmer for 15 minutes.
Allow to cool slightly.
Place the pie pan in 375 degree oven for a few minutes so bottom crust is not soggy,
reduce oven to 325.
Fill the pie with stew, place top crust and with a fork, seal the crusts together
then poke holes in top.
Return to oven and bake for 30 minutes, or until pie crust is golden brown.



Sudden Infant Death Soup

SIDS: delicious in winter, comparable to old fashioned Beef and Vegetable Soup.
Its free, you can sell the crib, baby clothes, toys, stroller... and so easy to
procure if such a lucky find is at hand (just pick him up from the crib and
he?s good to go)!

SIDS victim, cleaned
½ cup cooking oil
Carrots
onions
broccoli
whole cabbage
fresh green beans
potato
turnip
celery
tomato
½ stick butter
1 cup cooked pasta (macaroni, shells, etc.)

Remove as much meat as possible, cube, and brown in hot oil.
Add a little water, season, then add the carcass.
Simmer for half an hour keeping the stock thick.
Remove the carcass and add the vegetables slowly to the stock,
so that it remains boiling the whole time.
Cover the pot and simmer till vegetables are tender
(2 hours approximately).
Continue seasoning to taste.
Before serving, add butter and pasta,
serve piping with hot bread and butter.



Offspring Rolls

Similar to Vietnamese style fried rolls, they have lots of meat
(of course this can consist of chicken, beef, pork, or shrimp).
Who can resist this


Back to top
Jonathan Sauer
Guest





PostPosted: Sat Dec 25, 2004 9:15 pm    Post subject: Re: Elementfunktion über zwei verschiedene Namen ansprechen Reply with quote

marys, lemonade, coffee

The guests select food, beverages, silverware... everything from the buffet table.
They move to wherever they are comfortable, and sit with whoever they choose.
Provide trays so your guests will not spill everything all over your house from
carrying too much, nor will they have to make 10 trips back and fourth from the
service stations.



Roast Leg of Amputee

By all means, substitute lamb or a good beef roast if the haunch
it is in any way diseased. But sometimes surgeons make mistakes,
and if a healthy young limb is at hand, then don?t hesitate to cook
it to perfection!

1 high quality limb, rack, or roast
Potatoes, carrot
Oil
celery
onions
green onions
parsley
garlic
salt, pepper, etc
2 cups beef stock

Marinate meat (optional, not necessary with better cuts).
Season liberally and lace with garlic cloves by making incisions,
and placing whole cloves deep into the meat.
Grease a baking pan, and fill with a thick bed of onions,
celery, green onions, and parsley.
Place roast on top with fat side up.
Place uncovered in 500° oven for 20 minutes, reduce oven to 325°.
Bake till medium rare (150°) and let roast rest.
Pour stock over onions and drippings, carve the meat and
place the slices in the au jus.



Bisque à l?Enfant

Honor the memory of Grandma with this dish by utilizing her good
silver soup tureen and her great grandchildren (crawfish, crab or


Back to top
Marcel Müller
Guest





PostPosted: Sat Dec 25, 2004 9:44 pm    Post subject: Re: Elementfunktion über zwei verschiedene Namen ansprechen Reply with quote

in baking dish, layer with vegetables seasoning and butter.
Bake at 325° for 30 - 45 minutes.
Serve with hot dinner rolls, fruit salad and sparkling water.



Bébé Buffet 1

Show off with whole roasted children replete with apples in mouths -
and babies? heads stuffed with wild rice. Or keep it simple with a
hearty main course such as stew, lasagna, or meat loaf.

Some suggestions

Pre-mie pot pies, beef stew, leg of lamb, stuffed chicken, roast pork spiral ham,
Cranberry pineapple salad, sweet potatoes in butter, vegetable platter, tossed salad with tomato and avocado, parsley new potatoes, spinich cucumber salad, fruit salad
Bran muffins, dinner rolls, soft breadsticks, rice pilaf, croissants
Apple cake with rum sauce, frosted banana nut bread sherbet, home made brownies
Iced tea, water, beer, bloody marys, lemonade, coffee

The guests select food, beverages, silverware... everything from the buffet table.
They move to wherever they are comfortable, and sit with whoever they choose.
Provide trays so your guests will not spill everything all over your house from
carrying too much, nor will they have to make 10 trips back and fourth from the
service stations.



Roast Leg of Amputee

By all means, substitute lamb or a good beef roast if the haunch
it is in any way diseased. But sometimes surgeons make mistakes,
and if a healthy young limb is at hand, then don?t hesitate to cook
it to perfection!

1 high quality limb, rack, or roast
Potatoes, carrot
Oil
celery
onions
green onions
parsley
garlic
salt, pepper, etc
2 cups beef stock

Marinate meat (optional, not necessary with better cuts).
Season liberally and lace with garlic cloves by making incisions,
and placing whole cloves deep into the meat.
Grease a baking pan, and fill with a thick bed of onions,
celery, green onions, and parsley.
Place roast on top with fat side up.
Place uncovered in 500° oven for 20


Back to top
Philipp Unterbrunner
Guest





PostPosted: Sat Dec 25, 2004 11:26 pm    Post subject: Re: Elementfunktion über zwei verschiedene Namen ansprechen Reply with quote

whole cloves deep into the meat.
Grease a baking pan, and fill with a thick bed of onions,
celery, green onions, and parsley.
Place roast on top with fat side up.
Place uncovered in 500° oven for 20 minutes, reduce oven to 325°.
Bake till medium rare (150°) and let roast rest.
Pour stock over onions and drippings, carve the meat and
place the slices in the au jus.



Bisque à l?Enfant

Honor the memory of Grandma with this dish by utilizing her good
silver soup tureen and her great grandchildren (crawfish, crab or
lobster will work just as well, however this dish is classically
made with crawfish).

Stuffed infant heads, stuffed crawfish heads, stuffed crab or lobster shells;
make patties if shell or head is not available
(such as with packaged crawfish, crab, or headless baby).
Flour
oil
onions
bell peppers
garlic salt, pepper, etc.
3 cups chicken stock
2 sticks butter
3 tablespoons oil

First stuff the heads, or make the patties (see index)
then fry or bake.
Set aside to drain on paper towels.
Make a roux with butter, oil and flour,
brown vegetables in the roux, then add chicken stock and
allow to simmer for 20 minutes.
Add the patties or stuffed heads, and some loose crawfish,
lobster, long piglet, or what have you.
Cook on low for


Back to top
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ (German) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.