Are C variables initialized to 0 by default?
Only global/static variables are, local variables aren't.
To calculate the area of a triangle you need
Your structure would include (at a minimum) the coordinates of the points, eg:
struct triangle
{
int xa, ya;
int xb, yb;
int xc, yc;
};
then you would declare a structure to hold the points and use it to calculate the area, eg:
struct triangle t1;
t1.xa = 0; t1.ya = 0;
t1.xb = 5; t1.yb = 5;
t1,xc = 7; t1.yc = 7;
area = calculate_area(&t1);
To calculate the area, you could put it into a function:
struct triangle *tru;
{
area = (
return area;
}
I'll let you think about:
and put the program together.
Exactly what data you want to store in the struct (minimum the points, but you may want to store the area of the triangle as well - in future you could expand to include calculating the side lengths and angles)
Why would a user blink and unblink a drive in a raid array?
to help identify the location of the drive
What types of puberty are there?
... I'm not really sure what you mean?
I mean there are male and female but do you mean the effects of puberty and what parts of the body they effect and how?
Which encryption algorithm is better and why?
If you're talking about symmetric key encryption (the kind where you just use one key for encryption and decryption), then arguably, the best encryption algorithm you can use is the Rijndael algorithm, better known now as AES (advanced encryption standard). It is the encryption standard used by the U.S. government for classified information. It is fast, requires little memory, and the only potential attacks against it are highly theoretical.
Rijndael beat out Twofish and Serpent in the AES standard contest, but those other two algorithms will provide more than enough security as well. In the end, it doesn't really matter, since most successful attacks are made simply by finding out your key through brute force, espionage or extortion, rather than pure data analysis.
Humans are almost always the weakest point when it comes to security, and it doesn't matter what algorithm you use if someone can guess your password.
What time is it when the sum of the digits on a digital clock is the greatest?
One second to eight pm? 19:59:59 adding to 38.
Who are the main characters from Pendragon by D J Machale?
Bobby Pendragon, Press Tilton, Saint Dane, Mark Dimond and Courtney Chetwynde. Well, I think Bobby's acolytes are pretty important
Is C programming works without assembler compiler interpreter?
No, a C program cant work without an interpreter or compiler or assembler as the code written in the program is not understood directly by the computer so it needs any of the above translator program to make the program understandable to the computer.
-Shruti JainWhat is button in Visual C plus plus?
A button is more correctly named a command button. It is an ActiveX control that is derived from a CWnd object. Command buttons can be resized, restyled, and can be assigned a caption and/or an image. Programmers can override command button methods (such as OnLButtonDown/OnLButtonUp and OnKeyDown/OnKeyUp) to invoke specific actions.
To write a C++ program to display the student details using class and array of
object.
What is the use of auxiliary array in merge sort?
In merge sort the whole is divided into two sub arrays. (This way of solving problem is called Divide and conquer algorithm) These sub arrays are called auxiliary arrays. First an array A is divided into two auxiliary arrays A1 and A2. Now these auxiliary arrays are further divided until we reach a stage with an auxiliary array of 2 elements. These 2 elements are arranged in incremental order and merged with the previous divided arrays. So we can say that auxiliary array is used to implement the basic principle of merge sort.
What is the slope-intercept form of the line 3x - 4y 1?
Slope intercept form is written in the form y = mx + b, where b is the y-intercept when x = 0, and m is the slope of the line. Then, this equation 3x - 4y = 1 in changed to y = -3/4x + 1/4.
A multithreaded system comprising of multiple user-level
threads cannot make use of the different processors in a multiprocessor
system simultaneously. The operating system sees only a single process
and will not schedule the different threads of the process on separate
processors. Consequently, there is no performance benefit associated
with executing multiple user-level threads on a multiprocessor system.
The correct spelling is exponential notation. An exponential notation gets rid of zeroes and simplifies numbers. It allows you to move the decimal point in numbers.
What BASIC program can compute and display all prime numbers from 1 to 40?
PRINT 2,3,5,7,11,13,17,19,23,29,31,37
Create a parameter by enclosing a value in a criterion in curly braces?
no you enclose them in [value] these kind of bracets!
What type of loop always execute at least once?
A do-while loop always executes at least once, and works like this:
do
{
//code, such as incrementing a value, printing text, etc.
} while (expressionToEvaluate);
a perfect example of this would be something like:
<code>
int i = 10;
int counter = 0;
do
{
counter+=i;
i--;
} while (i > 0);
</code>
Design modulus16 up counter using j-k flipflop?
1st of ol as it is given that it is modulo 16
therefore M=16
N= no of f/f
M=2^N
M=2^4
there for we require 4 no of j-k f/f
connect them serially
make the counter table from 0-15 as it is up counter.
and then draw connection dig
Are reference variables are NOT available in C?
Yes, reference variables are permitted in C. However a reference variable in C is simply another name for a pointer variable, because pointers can be dereferenced to allow indirect access to the memory they point at.
However, in C++, references are neither pointers nor variables, they serve another purpose altogether, one which is not available in C. So the real answer is that C++ references are not available in C, but reference variables are.
Although it is common practice to avoid using the term reference lest there be any confusion with a C++ reference, it doesn't alter the fact that a C pointer variable is also a C reference variable. They are one and the same thing.
In C++, a reference is entirely different from a C reference. More specifically, it is an alias, an alternate name, for a memory address. Unlike pointer variables, a reference consumes no memory of its own. That is, you cannot obtain the address of a reference since there is none to obtain. Hence the 'address of' operator (&) is used during instantiation to signify that the instance name is actually a reference of the specified type, and not a variable of the type.
The address being referred to must also be assigned to the reference when the reference is instantiated. That is, you cannot declare a reference and then assign a memory address to it elsewhere in your code. By the same token, you cannot subsequently reassign a reference while it remains in scope. Remember, references are not variables. What they refer to may be variable, but not the reference itself. In that respect it is not unlike like a constant pointer to a variable.
References allow you to refer to the same memory address using one or more aliases. Since they consume no memory of their own, there is no practical limit to the number of aliases you can have in your C++ program. When compiled, all references to the same memory are effectively replaced with the actual memory address, or the address of a static location containing the actual memory address if the address was allocated dynamically. So while references are often implemented just as if they were pointers, this is only of concern to developers of C++ compilers. In more general C++ source code, the two concepts must be kept distinct.
C++ references are also much easier to work with than pointers. Whereas pointers to allocated memory must be manually released when no longer required, references do not. When a referenced object falls from scope, the object's destructor is called automatically. More importantly, references can never be NULL so, if you have a reference, a valid object of the specified type is guaranteed to exist at the referred memory location. The only time you will encounter problems with references is when you point at them, and then delete the pointer! If you subsequently access the referenced memory or the reference falls from scope, your program will exhibit undefined behaviour. Obviously this is a programming error, but these type of problems exist with pointers in general, hence pointers are best avoided as much as is possible. If an object is guaranteed to exist, then refer to it, don't point at it. Only use a pointer when an object is not guaranteed to exist, or if you need to change the address being referred to. And if a pointer is non-NULL, refer to the object.