Welcome to Dream.In.Code
Getting C++ Help is Easy!

Join 136,480 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,708 people online right now. Registration is fast and FREE... Join Now!




OBJECT ORIENTED PROGRAMMES IN C++

 
Reply to this topicStart new topic

OBJECT ORIENTED PROGRAMMES IN C++, CLASS II

sonal_munish
5 Mar, 2008 - 05:01 PM
Post #1

New D.I.C Head
*

Joined: 22 Oct, 2007
Posts: 2


My Contributions
[fo/* va_arg example */
#include <stdio.h>
#include <stdarg.h>

int FindMax ( int amount, ...)
{
int i,val,greater;
va_list vl;
va_start(vl,amount);
greater=va_arg(vl,int);
for (i=1;i<amount;i++)
{
val=va_arg(vl,int);
greater=(greater>val)?greater:val;
}
va_end(vl);
return greater;
}

int main ()
{
int m;
m= FindMax (7,702,422,631,834,892,104,772);
printf ("The greatest one is: %d\n",m);
return 0;
}
nt=Arial][size=2]
User is offlineProfile CardPM
+Quote Post

baavgai
RE: OBJECT ORIENTED PROGRAMMES IN C++
5 Mar, 2008 - 05:22 PM
Post #2

Dreaming Coder
Group Icon

Joined: 16 Oct, 2007
Posts: 2,031



Thanked: 105 times
Dream Kudos: 475
Expert In: C, C++, Java, C#, ASP.NET, PHP, Perl, Python, Oracle, SQL Server, MySql, HTML, JavaScript, Lua

My Contributions
Is there a question here?

Also, what's the point of copying the code from another site? Just read the info there: http://www.cplusplus.com/reference/clibrar...arg/va_arg.html
User is online!Profile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 12/2/08 06:48PM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month