How to receive strings with spaces in scanf()

Answer Posted / rushabh

scanf("[^\n]s",s);

Is This Answer Correct ?    5 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

When should we use pointers in a c program?

643


How can I run c program?

699


What are the string functions? List some string functions available in c.

615


Does sprintf put null character?

611


Write a C program to help a HiFi’s Restaurant automate its breakfast billing system. Your assignment should implement the following items: a. Show the customer the different breakfast items offered by the HiFi’s Restaurant. b. Allow the customer to select more than one item from the menu. c. Calculate and print the bill to the customer. d. Produce a report to present your complete program and show more sample output. Assume that the HiFi’s Restaurant offers the following breakfast menu: Plain Egg $2.50 Bacon and Egg $3.45 Muffin $2.20 French Toast $2.95 Fruit Basket $3.45 Cereal $0.70 Coffee $1.50 Tea $1.80

2566






What are the different types of data structures in c?

614


What is the purpose of 'register' keyword in c language?

637


Why is event driven programming or procedural programming, better within specific scenario?

1959


Explain the meaning of keyword 'extern' in a function declaration.

738


What is the right type to use for boolean values in c?

595


What is the use of sizeof () in c?

573


What is the difference between functions abs() and fabs()?

659


Is there anything like an ifdef for typedefs?

713


What is a nested formula?

616


Tell me about low level programming languages.

651