C and C++

Moderators: None (Apply to moderate this forum)
Number of threads: 28695
Number of posts: 94715

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
functions in C++ Posted by albinoesme on 6 Nov 2010 at 12:38 PM
I am new to programming and I was wondering if anybody could help me out. I am using Bloodshed, and these two problems are really giving me a tough time, I cannot figure them out. Any help is greatly appreciated!

I am to write a function prototype for both of these...

1. A function named check() that has three parameters. The first parameter should accept an integer number, and the second and third parameters should accept variables of type double. The function returns no value.


2. A function named findAbs() that accepts a integer passed to it and returns a double.
Report
Re: functions in C++ Posted by AsmGuru62 on 6 Nov 2010 at 4:28 PM
So, did you search anything on the web?
Prototype in C++ may be in the following form:

<returned_type> <function_name> (<param_type1>, <param_type2>, etc. ) ;

Here ai an example of function called foo - it takes one integer parameter and returns a double value:
double foo (int);
Report
This post has been deleted. Posted by bbbnnn on 7 Nov 2010 at 5:57 AM
This post has been deleted.
Report
Re: functions in C++ Posted by pseudocoder on 8 Nov 2010 at 1:56 PM
once you've got the requirement... just apply C++ to it. what keyword can you use that is in effect "empty?"

1) void check(int, double, double);

2) double findAbs(int);



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.