Is the following code legal?

struct a

{

int x;

struct a *b;

}

Answer Posted / susie

Answer :

Yes.

Explanation:

*b is a pointer to type struct a and so is legal. The
compiler knows, the size of the pointer to a structure even
before the size of the structure

is determined(as you know the pointer to any type is of same
size). This type of structures is known as
‘self-referencing’ structure.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to palindrom string in c language?

9862


How can you relate the function with the structure? Explain with an appropriate example.

3138


Design an implement of the inputs functions for event mode

3191


why do you use macros? Explain a situation where you had to incorporate macros in your proc report? use a simple instream data example with code ?

2524


write a function to give demostrate the functionality of 3d in 1d. function prototye: change(int value,int indexX,int indexY,int indexZ, int [] 1dArray); value=what is the date; indexX=x-asix indexY=y-axis indexZ=z-axis and 1dArray=in which and where the value is stored??

4406


how to programme using switch statements and fuctions, a programme that will output two even numbers, two odd numbers and two prime numbers of the users chioce.

2366


Develop a routine to reflect an object about an arbitrarily selected plane

3293


Set up procedure for generating a wire frame display of a polyhedron with the hidden edges of the object drawn with dashed lines

3270


3) Int Matrix of certain size was given, We had few valu= es in it like this. =97=97=97=97=97=97=97=97=97=97=97 1 = | 4 | | 5 | &= nbsp; | 45 =97=97=97=97=97=97=97=97=97=97=97 &n= bsp; | 3 | 3 | 5 | = | 4 =97=97=97=97=97=97=97=97=97=97=97 34 |&nbs= p; 3 | 3 | | 12 | &= nbsp; =97=97=97=97=97=97=97=97=97=97=97 3 | &nbs= p; | 3 | 4 | = | 3 =97=97=97=97=97=97=97=97=97=97=97 3 | = ; | | | = ; 3 | =97=97=97=97=97=97=97=97=97=97=97 &= nbsp; | | 4 | = ; | 4 | 3 We w= ere supposed to move back all the spaces in it at the end. Note: = If implemented this prog using recursion, would get higher preference.

3524


Write a Program in 'C' To Insert a Unique Number Only. (Hint: Just Like a Primary Key Numbers In Database.) Please Some One Suggest Me a Better Solution for This question ??

2157


could you please send the program code for multiplying sparse matrix in c????

3301


Write a program to model an exploding firecracker in the xy plane using a particle system

3885


write a program for area of circumference of shapes

2251


Cluster head selection in Wireless Sensor Network using C programming language.

3405


Given a spherical surface, write bump-mapping procedure to generate the bumpy surface of an orange

3090