#include<stdio.h>
main()
{
struct xx
{
int x=3;
char name[]="hello";
};
struct xx *s;
printf("%d",s->x);
printf("%s",s->name);
}
Answer Posted / rahulkulkarni
There is no syntax error.
Pointer s is declared but never initialized.
Using uninitialized pointer , trying to access members(x and name) of structure results in invalid access of memory.
Hence segmentation fault.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Develop a routine to reflect an object about an arbitrarily selected plane
What is data _null_? ,Explain with code when u need to use it in data step programming ?
Write a program to model an exploding firecracker in the xy plane using a particle system
Design an implement of the inputs functions for event mode
why nlogn is the lower limit of any sort algorithm?
Cluster head selection in Wireless Sensor Network using C programming language.
What is full form of PEPSI
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.
Can you send Code for Run Length Encoding Of BMP Image in C Language in linux(i.e Compression and Decompression) ?
How to palindrom string in c language?
how to create a 3x3 two dimensional array that will give you the sums on the left and bottom columns
#include
How do you verify if the two sentences/phrases input is an anagram using predefined functions in string.h and by using arrays?
write a simple calculator c program to perform addition, subtraction, mul and div.
write a program for area of circumference of shapes