There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
antivirus audio avg avg 8 bios boot browser bsod computer cpu crash css dell desktop driver drivers dvd email error excel explorer firefox firefox 3 freeze game graphics hard drive hardware help please hijackthis hjt install internet internet explorer itunes javascript keyboard lan laptop malware missing monitor msn network networking openoffice outlook outlook 2003 outlook express php popups problem router seo slow sound sp3 spyware trojan usb video virus vista vundo windows windows vista windows xp winxp wireless word
Software Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Software Development >
C++ help!


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

 
Thread Tools
bootsiebella's Avatar
Junior Member with 12 posts.
 
Join Date: Mar 2008
10-May-2008, 12:50 AM #1
C++ help!
I don't understand what this problem is asking can anyone get me on the right track

For the next group of questions assume these function definitions.
int f(int n){
for (int i=0; i<n; i++) {
cout << "f";
}
return n-1;
}

void h(int m){
cout << "h";
f(m-1); // return value of f is ignored.
cout << "h";
return;
}
What is printed by the following statements
__________ f(3);
__________ f(f(3));
__________ f(3) + f(3);
__________ h(3);
__________ h(f(3));
Shadow2531's Avatar
Distinguished Member with 2,623 posts.
 
Join Date: Apr 2001
11-May-2008, 05:55 AM #2
It looks like it says:

Create a program that defines the following functions. Then, call those functions in these different ways and tell me what was printed for each way.
violentMagician's Avatar
Computer Specs
Account Disabled with 10 posts.
 
Join Date: May 2008
Location: India
Experience: Intermediate
11-May-2008, 05:56 AM #3
f(3) ------> fff
f(f(3)) ----> fffff
f(3)+f(3)-> ffffff
h(3) ------> hffh
h(f(3))----> fffhfh

i think....confirm it!
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are Off
Refbacks are Off

You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 06:22 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.