answersLogoWhite

0


Best Answer

struct thisorthat *ptr;

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How is a structure type pointer variable declared in c?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What is generic pointer in C?

When a variable is declared as being a pointer to type void it is known as a generic pointer. Since you cannot have a variable of type void, the pointer will not point to any data and therefore cannot be dereferenced. It is still a pointer though, to use it you just have to cast it to another kind of pointer first. Hence the term Generic pointer.


What is the difference between structure and pointer?

A structure is a collection of primitives or other structures. A pointer is a memory address. Comparison of the two is like comparing bowling balls to cinder blocks. You can say that a structure defines the layout of the data, while a pointer points to data that is a particular structure.


What is the difference between the structure tag and structure variable?

The structure tag is a type. The structure variable is an instance of that type.


What is poiner value in c?

In c a pointer is a variable that points to or references a memory location in which data is stored. Each memory cell in the computer has an address that can be used to access that location so a pointer variable points to a memory location we can access and change the contents of this memory location via the pointer. Pointer declaration A pointer is a variable that contains the memory location of another variable. The syntax is as shown below. You start by specifying the type of data stored in the location identified by the pointer. The asterisk tells the compiler that you are creating a pointer variable. Finally you give the name of the variable. type * variable name Example: int *ptr; float *string;


How many pointers can be used in a c program?

Answergenerally we use simple pointer, void pointer,null pointer, structure pointer. Answerzero or more (unlimited).

Related questions

How is a structure type pointer variable declared?

struct thisorthat *ptr;


How is structure type pointer variable declared?

struct thisorthat *ptr;


What is generic pointer in C?

When a variable is declared as being a pointer to type void it is known as a generic pointer. Since you cannot have a variable of type void, the pointer will not point to any data and therefore cannot be dereferenced. It is still a pointer though, to use it you just have to cast it to another kind of pointer first. Hence the term Generic pointer.


What is an identify?

An identifier is nothing but a data type. It may variable, content, structure or a pointer.


What is the difference between structure and pointer?

A structure is a collection of primitives or other structures. A pointer is a memory address. Comparison of the two is like comparing bowling balls to cinder blocks. You can say that a structure defines the layout of the data, while a pointer points to data that is a particular structure.


What happens if we use an integer pointer as a member of structure instead of structure pointer?

By declaring an integer pointer you are declaring that any non-zero reference stored in the pointer is guaranteed to be an integer reference. In order to guarantee the reference is actually a structure, the pointer must be declared as such, because casting an integer to a structure can never be regarded as being type-safe.


What is void pointer variable?

A void pointer variable is a pointer variable (of some type) that is assigned the value zero, meaning it points to address zero. Memory address zero is a reserved address, which means the pointer variable references nothing in particular.


If the variable flag can only be declared once in the program it was declared as what type of variable?

It's a global variable.


What is the difference between the structure tag and structure variable?

The structure tag is a type. The structure variable is an instance of that type.


How many types of pointers are there?

That depends on what you consider a type. A pointer variable simply stores a memory address or NULL so, strictly speaking, there is only one type of pointer. A pointer variable's type (int *, char *, void *, etc) determines the type that a pointer points to, not the type of the pointer itself. Whether a pointer points to a primitive type, a user-defined type, a function, another pointer or void, makes no difference to the pointer variable itself. It simply stores a memory address. How you treat that memory address is determined by the pointer variable's type. So, in that respect, there are as many types of pointer as there are types to point at; which would be infinite. The architecture determines the size of a pointer variable. On a 16-bit system, a pointer will occupy just 2 bytes, while on a 32-bit system it occupies 4 bytes and 8 bytes on a 64-bit system. Although these may be considered separate pointer types, you can't pick and choose which type you use. The size must be consistent for any given architecture, hence the prevalent use of the sizeof() operator to determine a variable's length at runtime.


What is poiner value in c?

In c a pointer is a variable that points to or references a memory location in which data is stored. Each memory cell in the computer has an address that can be used to access that location so a pointer variable points to a memory location we can access and change the contents of this memory location via the pointer. Pointer declaration A pointer is a variable that contains the memory location of another variable. The syntax is as shown below. You start by specifying the type of data stored in the location identified by the pointer. The asterisk tells the compiler that you are creating a pointer variable. Finally you give the name of the variable. type * variable name Example: int *ptr; float *string;


How many pointers can be used in a c program?

Answergenerally we use simple pointer, void pointer,null pointer, structure pointer. Answerzero or more (unlimited).