Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

#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


Please Help Members By Posting Answers For Below Questions

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

3604


What is data _null_? ,Explain with code when u need to use it in data step programming ?

3336


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

4132


Design an implement of the inputs functions for event mode

3508


why nlogn is the lower limit of any sort algorithm?

2842


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

3733


What is full form of PEPSI

2408


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.

2669


Can you send Code for Run Length Encoding Of BMP Image in C Language in linux(i.e Compression and Decompression) ?

4393


How to palindrom string in c language?

11042


how to create a 3x3 two dimensional array that will give you the sums on the left and bottom columns

3637


#include int main(void) { int a=4, b=2; a=b<>2 ; printf("%d",a); return 0; }

1622


How do you verify if the two sentences/phrases input is an anagram using predefined functions in string.h and by using arrays?

2535


write a simple calculator c program to perform addition, subtraction, mul and div.

3722


write a program for area of circumference of shapes

2561