answersLogoWhite

0

int * gred ;

gred = new int [100] ; // this example snippet creates 100 ints

User Avatar

Wiki User

15y ago

What else can I help you with?

Continue Learning about Engineering

What is the process of allocation of memory for an integer type variable?

To dynamically allocate memory, use the following function (stdlib.h I believe): int *variable1 = malloc(sizeof(int));


How do we write a program to print your name age address using read data statement in QBASIC?

In QBASIC, you can use the INPUT statement to read data for your name, age, and address. Here's a simple program example: DIM name AS STRING DIM age AS INTEGER DIM address AS STRING INPUT "Enter your name: ", name INPUT "Enter your age: ", age INPUT "Enter your address: ", address PRINT "Name: "; name PRINT "Age: "; age PRINT "Address: "; address This program prompts the user to enter their name, age, and address, then prints the collected information.


Explain pointer with the help of an example?

Pointers are data types that hold integer values, those "integer" values are simply addresses of another variables.Example:int x = 15; // this is an integer variable with value 15int* ptr; // this is a pointer to an integerptr = &x; // now we assigned the address of x to the pointer ptr// if you want to access the value of x (15 in this example),// you should use the deterrence *// so you can say:printf("%d", *ptr); // this will print 15// you can print the value of ptr (which is the address of x) using:printf("%p", ptr); // this will print an integer, which is the address of x.==========================================================More explanation, let's imagine that this is a memory:-00--01-02-03-04 =====> these are the address of the memory|--- |--- |---|---|---| =====> values inside the memoryFor the example I gave before, let's imagine the following:-00-01-02--03--04|---|15|--- | 01 |---|------x------- ptrAs you can see, x hold the value 15, ptr holds the value 01 which is actually the address of x. Now ptr have a distinct address too, which is 03.In reality, the address of a memory is longer, and usually represented as hexadecimal values. example 0x002154You can find more information here:http://en.wikipedia.org/wiki/Pointers


What is the purpose of the dereference operator when used with a pointer variable?

Data type is mandatory in every variable-declaration.Example:int i; -- integerint *pi; -- integer-pointerint ai[10]; -- integer-arrayint *api[10]; -- array of integer-pointersint (*api)[10]; -- pointer to integer-array


What is the use of Default statement in switch case?

C++ Provides a multiple branch selection called as switch. This selection statement succesively test against a list of integer or character constants. When a match is found the statements associate with constants are executed. When no match is found default statement is used.

Related Questions

What is the process of allocation of memory for an integer type variable?

To dynamically allocate memory, use the following function (stdlib.h I believe): int *variable1 = malloc(sizeof(int));


Which statement is true the square root of an integer will always be an integer or the square of an integer will always be an integer?

the square of an integer will always be an integer


What is the integer of A gain of 5 yards on the first down write integer that is represented in statement?

5


Do Prove that the product of an integer and arbitrary integer is even?

The statement is not true. Disprove by counter-example: 3 is an integer and 5 is an integer, their product is 15 which is odd.


What statement is true if P is an Integer and Q is a nonzero integer?

Any fraction p/q where p is an integer and q is a non-zero integer is rational.


When comparing two integers the integer with the bigger absolute value is always the greater integer?

The statement is false.


Given two is an even integer or three is an even integer Determine the truth value of this disjunction Justify your answer?

True. The first statement is true and the second statement is false. In a disjunction, if either statement is true, the disjunction is true.


Find 3 consecutive even integers if the product of the first integer and two two less than the second integer is four more than five times the third integer and what is the let statement?

The let statement is: let the smallest of the three integers be x.


What does writing an integer greater than itself mean?

It is an invalid statement.


What is an arbitrary positive integer?

"Arbitrary" simply means any. So this refers to any positive integer. It may be used to make a statement that is true for every positive integer.


What stament is always trueabout the sum of a negtive integer and positive integer?

The statement is: "Their sum is always an integer." Whether the sum is negative or positive depends on the two original integers.


How do we write a program to print your name age address using read data statement in QBASIC?

In QBASIC, you can use the INPUT statement to read data for your name, age, and address. Here's a simple program example: DIM name AS STRING DIM age AS INTEGER DIM address AS STRING INPUT "Enter your name: ", name INPUT "Enter your age: ", age INPUT "Enter your address: ", address PRINT "Name: "; name PRINT "Age: "; age PRINT "Address: "; address This program prompts the user to enter their name, age, and address, then prints the collected information.