My Paper 27/02/2013
#include<iostream.h>
void sample_function(double test) throw (int);
int main()
{
try
{
cout ”Trying.\n”;
sample_function(98.6);
cout “Trying after call.\n”;
}
catch(int)
{
cout “Catching.\n”;
}
cout “End program.\n”;
return 0;
}
void sample_function(double test) throw (int)
{
cout “Starting sample_function.\n”;
if(test < 100)
throw 42;
}
- Function templates?
- There are some errors in the code given below, you have to Indicate the line no. with error/s (code is about This is class 2)
- Abstraction? And its uses?
- Name of error handling any two.
- what about static variable when non-static variable are intiiolize?
- in which situation virtual inheritance needed?
- find coding error from resource management topic
#include<iostream.h>
void sample_function(double test) throw (int);
int main()
{
try
{
cout ”Trying.\n”;
sample_function(98.6);
cout “Trying after call.\n”;
}
catch(int)
{
cout “Catching.\n”;
}
cout “End program.\n”;
return 0;
}
void sample_function(double test) throw (int)
{
cout “Starting sample_function.\n”;
if(test < 100)
throw 42;
}
- write a template function maximum which takes two arguments of same type, that returns the larger number
- write a template function which gives average having it’s name and proper size of array.
0 comments
Post a Comment