Archive for cplus plus programs
You are browsing the archives of cplus plus programs.
You are browsing the archives of cplus plus programs.
21. Differentiate the following notations?
I: :obj1 :obj2
II: :obj1 :obj2
In the above representation I, obj1 sends message to obj2. But in the case of II the [...]
21. Differentiate the following notations?
I: :obj1 :obj2
II: :obj1 :obj2
In the above representation I, obj1 sends message to obj2. But in the case of II the [...]
1. What do you mean by analysis and design?
Analysis:
Basically, it is the process of determining what needs to be done before how it should be done. In order to accomplish this, the developer refers the existing systems and documents. So, simply it is an art of discovery.
Design:
It is the process of [...]
1)
class Sample
{
public:
int *ptr;
Sample(int i)
{
ptr = new int(i);
}
~Sample()
[...]
main(int argc, char **argv)
{
printf("enter the character");
getchar();
sum(argv[1],argv[2]);
}
sum(num1,num2)
int num1,num2;
{
return num1+num2;
}
Answer:
Compiler error.
Explanation:
argv[1] & argv[2] are strings. They are passed to the function sum without converting it to integer values.
82)
# include <stdio.h>
int one_d[]={1,2,3};
main()
{
int *ptr;
ptr=one_d;
ptr+=3;
printf("%d",*ptr);
}
Answer:
garbage value
Explanation:
ptr pointer is pointing to out of the array range of one_d.
83)
# include<stdio.h>
aaa() {
[...]