answersLogoWhite

0

#include<iostream>

int main()

{

int x=42;

int* p=&x; // declare and initialise a pointer, assigning the address of x.

}

User Avatar

Wiki User

12y ago

What else can I help you with?

Related Questions

How is structure type pointer variable declared?

struct thisorthat *ptr;


How is a structure type pointer variable declared?

struct thisorthat *ptr;


How is a structure type pointer variable declared in c?

struct thisorthat *ptr;


How a variable is declared and initialized during declaration in c?

During declaration, the declaration goes like this: extern &lt;type&gt; &lt;variable-name&gt; or &lt;type&gt; &lt;function-name&gt; (&lt;parameter list&gt;);


Which variable has been initialized?

To determine which variable has been initialized, you would need to look at the code or context in which variables are defined. An initialized variable is one that has been assigned a value at the time of its declaration. For example, in Python, a variable like x = 5 is initialized because it has been given a specific value. If you provide a specific code snippet or context, I can help identify the initialized variable.


What variable is one that has been declared but has not been initialized or assigned value?

Uninitialized Page 59 Programming Logic and Design by Tony Gladdis


What variable is one that has been declared but has not been initialized or assigned a value?

Uninitialized Page 59 Programming Logic and Design by Tony Gladdis


What do you mean by initialization in c plus plus?

Not initialized variable: int myInt; Initialized variable: int myInt = 10;


What is the difference bw function pointer and function of pointer?

function pointer is a variable that hold the address of any function which declared in the program but function pointer is the array of the function that accept the run time size of the function.


What is pointer of pointer?

pointer is the variable that holds the address of another variable


What is Four parts on declaring a pointer?

Declaring a pointer involves four key parts: Data Type: Specifies the type of data the pointer will point to (e.g., int, float, char). Asterisk (*): Indicates that the variable being declared is a pointer. Pointer Name: The identifier used to reference the pointer variable. Initialization (optional): Assigning the pointer to the address of a variable using the address-of operator (&amp;) or setting it to nullptr for safety. For example, int *ptr; declares a pointer to an integer.


Why static variables are initialized to zero?

When a variable is declared, your computer assigns a section of memory to that variable. If the variable isn't initialized, there's no way of knowing what data is already stored in that section of memory, which can cause errors in your programs. In managed languages, such as C#, this is done automatically at declaration. Although it's still good practice to initialize variables yourself.