What is the use of register keyword in C?
The register keyword tells the compiler to store the variable onto the CPU register if space on the register is available. The reasoning is that register operations are always faster than memory operations and thus if used correctly, it can speed up an algorithm. However, the register keyword is a somewhat antiquated procedure since for quite a long time the optimizer in modern compilers are smart enough to detect when storing a variable on the register will be advantageous and will do so during optimization. There for, suggesting to the compiler to store a variable on the register can only make things slower if used incorrectly.
The register keyword tells the compiler to store the variable onto the CPU register if space on the register is available. The reasoning is that register operations are always faster than memory operations and thus if used correctly, it can speed up an algorithm. However, the register keyword is a somewhat antiquated procedure since for quite a long time the optimizer in modern compilers are smart enough to detect when storing a variable on the register will be advantageous and will do so during optimization. There for, suggesting to the compiler to store a variable on the register can only make things slower if used incorrectly.
In many programs a statement called return -EINVAL is usedwhat does it mean?
EINVAL means error - invalid argument.
Wether c and c required for ABAP in SAP?
Yes, you should have to some basic knowledge of c/c++. ts helps you a lot when you are doing abap.
Write a program in vb to check whether a no is prime or not?
Function isPrime(ByVal n As Integer) As Boolean
If n < 2 Then
Return False
End If
Dim sqrtn As Integer = Math.Sqrt(n) + 1
For i As Integer = 2 To sqrtn
If (n Mod i) = 0 Then
Return False
End If
Next
Return True
End Function
What is the major advantage of using C-V-P analysis?
What is the major advantage of using C-V-P graphs?
i think that te way to program a macro has somthing to do with holding th ctrl and alt buttons anddo somthing over and over thenyou let go of them and do it the exact same way again......but i am not sure so dont quote me on it
How can one determine what program is locking a file to prevent deletion?
http://www.dr-hoiby.com/WhoLockMe/
Been so long since I wrote c I cant remember much about it. You will have to create a key capture process. If someone enters a charchacter have the ascii value compared to a list of instructions that you want it to perform.
If 1 then replace value sent to screen with "one"If 2 then replace value sent to screen with "two"etc.
It is a relatively simple program. It has just been 15 yrs or so since I have written anything so I can only give you generic examples.
Hope this helps some.
What are the different types of surfboards?
longboards, shortboards; okay that is true, but those are only two types. you have Shortboards, generally used for large waves between 4-12 ft roughly. There are guns which have a shortboard shape, very skinny but tall high 6 foot up to 10 foot these are made for surfing BIG waves, double overhead and up. You have fish, which are shorter than shortboards but a lot fatter. Funboards, which are taller than shortboards, fatter, and have a more rounded nose. Longboards, which are usually 8 to 10 feet. Noseriders, which are taller than longboards, thicker in the nose and have more rocker so you can actually "ride the nose" then on top of that you have epoxy and fiberglass, hybrids like fun-fishes. All different types, and you can customize your own. Pintail, flat-tail, swallow-tail, or bat-tail to name a few. Hope this helped, if you have a beginner get yourself a longboard with a soft top
Can you use headers made for a 5.7L 1996 Chevy k1500 on a 5.0L 1996 Chevy K1500?
Yes thank you very much!
Can a pointer to char data-type be type casted to pointer to integer type?
Yes it is possible in C language.
int main(void) { char *cptr; int *iptr; iptr=(int*)cptr; return 0; }
If you find the info useful Please Vote!!!
What is the difference between define and undefine?
# define and # undef are compiler directives in C and C++. The # define directive creates a definition for something that will be replaced multiple times in the code.
For example:
# define HELLO 5
Creates an association between HELLO and replaces it with 5 in the code (for the compiler only).
The # undef (undefine) counterpart removes the definition from what the compiler sees. It is usually specified when either the definition should no longer be used or when the definition needs to change.
What is the famous Tower of Hanoi problem?
If you love puzzles, mathematics, or computer programming then the "Tower of Hanoi" problem is brain teaser designed just for you.
At first glance, the Tower of Hanoi problem appears to be a simple matter of trial and error. The problem consists of three wooden pegs. The center wooden peg contains 8 discs of varying size. The discs decrease in diameter from the bottom to top. For example, the bottom disc could be 8 inches in diameter and the disc on top of it could be 7 inches in diameter, continuing to the 8th disk, a 1 inch disc on the very top. At the beginning of the problem, the two remaining pegs do not contain any discs.
The goal of the Towers of Hanoi problem is to move all the discs from the center peg to one outside peg. Sounds easy, right? There are two rules that you must follow. Rule #1 is that you can move only one disc at a time. Rule #2 is that you can not place a larger disc on top of a smaller disc. This is the reason why there are three pegs in the problem as opposed to just two pegs.
The puzzle may be based on an Indian legend (Towers of Brahma) where (someplace in antiquity) there is a room with three posts having 64 disks. Brahmin priests are tasked with moving the disks from one post to another. When the task is done, the world will end. Based on moving the disks at one disk per second, this would take about 585 billion years. (18,446,744,073,709,551,615 moves)
Other variations of the legend exist.
---
The minimum number of moves for three pegs and n disks = (2^n) - 1, so for 8 disks, the number of moves should be 255. The first 3 moves are A1, B3, A3, followed by C1, A2, B1, A1.
Do you specify a storage class with typedef?
In C, "typedef" is a storage class, but sort of a weird one. It specifies that you are not actually creating an object, but merely defining a type. As such, there is nothing to be stored (at runtime). The other storage classes, auto, extern, register, and static, all specify actual storage.
What is the difference between 16 bit compilers and 32 bit compilers in C?
16 bit compilers compile the program into 16-bit machine code that will run on a computer with a 16-bit processor. 16-bit machine code will run on a 32-bit processor, but 32-bit machine code will not run on a 16-bit processor. 32-bit machine code is usually faster than 16-bit machine code.
-DJ Craig
NoteWith 16 bit compiler the type-sizes (in bits) are the following:short, int: 16
long: 32
long long: (no such type)
pointer: 16/32 (but even 32 means only 1MB address-space on 8086)
With 32 bit compiler the object-sizes (in bits) are the following:
short: 16
int, long: 32
long long: 64
pointer: 32
With 64 bit compiler the object-sizes (in bits) are the following:
short: 16
int: 32
long: 32 or 64 (!)
long long: 64
pointer: 64
[While the above values are generally correct, they may vary for specific Operating Systems. Please check your compiler's documentation for the default sizes of standard types]
Note: C language itself doesn't say anything about "16 bit compilers" and "32 bit compilers"
Can you explain in which scenario the primitive types are used as objects?
It is sometimes easier to deal with primitives as objects. Moreover most of the collection classes store objects and not primitive data types. And also the wrapper classes provide many utility methods also. Because of these resons we need wrapper classes. And since we create instances of these classes we can store them in any of the collection classes and pass them around as a collection. Also we can pass them around as method parameters where a method expects an object
It is sometimes easier to deal with primitives as objects. Moreover most of the collection classes store objects and not primitive data types. And also the wrapper classes provide many utility methods also. Because of these resons we need wrapper classes. And since we create instances of these classes we can store them in any of the collection classes and pass them around as a collection. Also we can pass them around as method parameters where a method expects an objectHow do you print all data in a Binary Search Tree?
By using Depth First Search or Breadth First search Tree traversal algorithm we can print data in Binary search tree.
Where can you find parts for a J C Higgins 1930 Pneumatic Pellgun?
It was probably made for Sears by one on the major pellet gun manufacturers in business in the thirties. Use a search engine for pellet 'gun repair' or 'air gun repair' and talk to those folks. They should be able to tell you what you have. You may have to show them pictures if you are able. berto
Many commonly used word have abbreviations. Teach is the abbreviation for teacher, though most do not use it as it sounds unprofessional.
What is thediffrence between ide and atapi?
IDE involves the interaction of the computer with hard drives and CD-ROMS. Atapi specifies the IDE tape drives and CD-ROMS.
Program to display multiplication of two matrix?
The matrix multiplication in c language : c program is used to multiply matrices with two dimensional array. This program multiplies two matrices which will be entered by the user.
Write a function that print a triangle of stars?
Function to print star triangle in c++
#include
#include
void starfunction(int); //You can give any function name
void main()
{
int a;
clrscr();
cout<<"Enter number of rows required:";
cin>>a;
star(a);
getch();
}
void starfunction(int r )
{
for(int i=1;i<=r;i++)
{
for(int j=1;j<=i;j++)
{
cout<<"*";
}
cout<<"\n";
}
}
Function to print star triangle in c
#include
#include
void starfunction(int); //You can give your own function name
void main()
{
int a;
clrscr();
printf("Enter number of rows required:");
scanf("%d",&a);
star(a);
getch();
}
void starfunction(int r )
{
int i,j;
for( i=1;i<=r;i++)
{
for( j=1;j<=i;j++)
{
printf("*");
}
printf("\n");
}
}
multiple alternative decision structure / case structure
What is a recursive relationship?
a function that recalls itself again and again is called recursive relationship.