C Programming - Structures, Unions, Enums - Discussion
Discussion Forum : Structures, Unions, Enums - Find Output of Program (Q.No. 8)
8.
What will be the output of the program in Turbo C (under DOS)?
#include<stdio.h>
int main()
{
struct emp
{
char *n;
int age;
};
struct emp e1 = {"Dravid", 23};
struct emp e2 = e1;
strupr(e2.n);
printf("%s\n", e1.n);
return 0;
}
Discussion:
60 comments Page 6 of 6.
Ranjith said:
1 decade ago
How can assign a string value to char variable?
Laxmi said:
1 decade ago
How it gives the output in capital letters?
Ram said:
6 years ago
@Deepak.
Dot and arrow both access.
Dot and arrow both access.
Punitha said:
1 decade ago
@ sringa boda.
You are brilliant.
You are brilliant.
Priya said:
1 decade ago
Its showing segmentation fault!
Srinag boda said:
1 decade ago
@fans: did u include string.h?
Parimal said:
1 decade ago
Nice explain thanks @priyanka.
Sajid said:
2 decades ago
Why no add the explanation.
Vrushali Vijay Bhoite said:
6 years ago
Thanks @Priyanka.
Hi_all said:
1 decade ago
Thanks Midhun.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers