Yes and no. It really depends on what the programmer decides. A GUI interface is usually composed of many objects, some of which may be part of the operating system's development kit (common controls), some of which may be user-defined and others which may be defined by a third-party. However, all objects respond to messages whenever a mouse cursor enters or leaves an object, or otherwise interacts with the object (moves or clicks upon the object). A programmer can intercept these messages and decide how the cursor should change, if at all.
How do you access and store the elements of array?
#include<stdio.h>
#include<conio.h>
int main(void)
{
int a[10],i;//array declaration
clrscr();
printf("\n enter the elements of array");
for(i=0;i<10;i++)
scanf("%d",&a[i]);
printf("\n the elements you enter into the array");
for(i=0;i<10;i++)
printf("%5d",a[i]);
getch();
return 0;
}
How procedural oriented programming language is interdependency?
Function which uses other function as part of it programming is known as function interdependent
How do you handle object array?
Exactly as you would any other type of array. An object's size is determined in the same way a structure's size is determined, by the sum total size of its member variables, plus any padding incurred by alignment.
However, you cannot create arrays of base classes. Arrays of objects can only be created when the class of object is final; a class that has a private default constructor, otherwise known as a "leaf" class. This is because derived classes can vary in size; array elements must all be the same size.
To create an array of base classes you must create an array of pointers to those base classes instead. Pointers are always the same size (4 bytes on a 32-bit system).
Static arrays are ideally suited to arrays of leaf objects where the number of objects never changes, or the maximum number of objects is finite and fixed. Although you can use dynamic arrays of leaf objects, you will incur a performance penalty every time the array needs to be resized, because every object's copy constructor must be called during the reallocation. Dynamic arrays are better suited to arrays of pointers to objects -- only the pointers need to be copied during resizing, not the objects they point to.
Write a program in c to draw a star and rotate it?
// asterisk pyramid
#include<iostream>
using namespace std;
int main()
{
int count = 0;
for (int width = 0; width <= 10; width++)
{
for (int alignLeft = width; alignLeft <= 15; alignLeft++)
{
cout << " ";
}
for (int space = 1; space < count; space++)
{
cout << "*";
}
cout << endl;
count += 2;
}
return 0;
}
What is do while loop in VB 6?
Structure:
do (while(expression) or until(expression))
.
.
.
loop (while(expression) or until(expression))
This is called a loop in VB and it is used to do something more than one times.
It may be used without any of the parameters "while" or "until" but in such case you have to make your code exit of the loop or most likely your program is going to stop responding.
The while parameter is used when we want the code in the loop to be executed WHILE the expression is True.
Example:
variable = variable + 1
The until parameter is used when we want the code in the loop to be executed until the expression gets True.
Example:
variable = variable + 1
How do you make chess game in c plus plus programming?
This question cannot be answered here. Go to amazon.com and find a book about chess-programming.
What is difference between c and oops?
C is a programming language, oops is what you say when you realize you were wrong in something. Note: Some programming languages are known as object-orient languages, C is not one of them, but some derivatives of it (C++, C#, Java) are.
Many researches show that relationship between watching violence on TV and violent behavioral patterns is positively correlated. Can we statistically say from this information that viewing violence on television causes children to behave in a violent way?
Explai the nature of the various types queues in data structures?
The queue is a linear data structure where operations of insertion and deletion are performed at separate ends also known as front and rear. Queue is a FIFO structure that is first in first out. A circular queue is similar to the normal queue with the difference that queue is circular queue ; that is pointer rear can point to beginning of the queue when it reaches at the end of the queue. Advantage of this type of queue is that empty location let due to deletion of elements using front pointer can again be filled using rear pointer. A priority queue is a queue in which each element is inserted or deleted on the basis of their priority. A higher priority element is added first before any lower priority element. If in case priority of two element is same then they are added to the queue on FCFS basis (first come first serve). Mainly there are two kinds of priority queue: 1) Static priority queue 2) Dynamic priority queue A double ended queue (or deque ) is a queue where insertion and deletion can be performed at both end that is front pointer can be used for insertion (apart from its usual operation i.e. deletion) and rear pointer can be used for deletion (apart from its usual operation i.e. insertion)
Why are operating systems written in the C language?
Speed, power, efficiency, well supported libraries, generally. Almost everything (But not absolutely everything.) has at least C bindings one can use.
Not to mention you're guaranteed to have the standard C library to handle a great deal of the core functionality of the program.
What is physical data structure and logical data structure?
Physical data structure: This is the physical equipment involved in the network eg router, cabling etc).
Logical data structure: This is how the information flows internally and externally (the transfer of information from one node to another on the network).
What is the difference between run time and compile time in c?
Compile time errors are detected at the compilation of a program. These are usually syntactical errors. A program cannot be compiled and hence executed if it contains a compile time error.
for example,
int a b=0;
above statement will produce a compile time error as a and b must be separated by a comma(,).
Runtime errors are logical errors. They don't affect the compilation of the program but causes a program to produce unwanted output. The program becomes buggy.
for example,
sum=sum-a[i];
in above statement, no syntactical error is present and hence the program will get executed successfully. But from a logical point of view, sum was supposed to be the addition of array elements. using minus(-) instead of plus(+) will give unwanted or incorrect output.
Logical or operator can be compared to what in terms of precedence?
The logical OR operator can be compared to ____ in terms of precedence.
Definite interations: Repeated sequence of calculations/ operations for a fixed number of repetitions. (Do or For loop) Indefinite iteration: no set limit on iterations, generally "while" loops. multiple interations is the same as multiple repetitions or trials.
Why is char often treated as integer data type?
The char data type is an integral type and can therefore be used to represent integers as well as characters. However, in order to treat the representation as an actual integer, it must be explicitly converted to a non-character type, such as int.
Swap 2 variable without a 3rd variable in c program?
This can be done using the bitwise exclusive-or(XOR) operator.
int X = 16 // Binary 010000
int Y = 32 // Binary 100000
X = X ^ Y // X = 110000
Y = X ^ Y // Y = 010000
X = X ^ Y // X = 100000
This is good to know but is not widely practiced, as it is far simpler to use a temporary variable, and less prone to bugs.
int temp = X;
X = Y;
Y = temp;
C program for finding square root of positive no?
#include<stdio.h>
#include<conio.h>
float SquareRoot(float num);
void main()
{
float input, ans;
clrscr();
printf("\n Enter The Number : ");
scanf("%f", &input);
ans = SquareRoot(input);
printf("\n Square Root : %f", ans);
getch();
}
float SquareRoot(float num)
{
if(num >= 0)
{
float x = num;
int i;
for(i = 0; i < 20; i ++)
x = (((x * x) + num) / (2 * x));
return x;
}
}
Should element in an array must be of primitive data type?
No, it can be array, structure or union as well.
What are some disadvantages of using case structures to program multiple alternative decisions?
Using case structures becomes difficult when programming multiple alternative decisions. Instead of listing each of the steps and executing them individually, it is easier to make decision structures and loops.