You don’t include &
(address) operator for %s
(strings) while reading. For example, in function getClient
, use
printf("Enter employee name: ");
scanf("%s", pemp->ename);
This is one of the problems in your program.
More Related Contents:
- Use of undeclared identifier 'o'
- please help me to find the error in this C code [closed]
- C pointer to array/array of pointers disambiguation
- Creating a daemon in Linux
- typedef fixed length array
- What’s an object file in C?
- Ways to ASSERT expressions at build time in C
- Is this a pointer to a pointer of the start of an array?
- Parameter Passing in C – Pointers, Addresses, Aliases
- Behaviour of printf when printing a %d without supplying variable name
- Calling Cython function from C code raises segmentation fault
- Unexpected output when printing directly to text video memory
- Is void a data type in C?
- Printing all global variables/local variables?
- Why are LIB files beasts of such a duplicitous nature?
- c get nth byte of integer
- Checking the stdin buffer if it’s empty
- C : typedef struct name {…}; VS typedef struct{…} name;
- atoi vs atol vs strtol vs strtoul vs sscanf
- Given an audio stream, find when a door slams (sound pressure level calculation?)
- What exactly does `-rdynamic` do and when exactly is it needed?
- Linked list recursive reverse
- Trouble reading a line using fscanf()
- note: previous implicit declaration of ‘point_forward’ was here
- Precision in C floats
- My floating point number has extra digits when I print it
- Representing EOF in C code?
- Inconsistent gcc diagnostic for string initialization
- “int *nums = {5, 2, 1, 4}” causes a segmentation fault
- How do I find the current machine’s full hostname in C (hostname and domain information)?