• +91 9723535972
  • info@interviewmaterial.com

C Interview Questions and Answers

Question - Why doesn't the following statement work?

Answer - char str[ ] = "Hello" ; strcat ( str, '!' ) ; The string function strcat( ) concatenates strings and not a character. The basic difference between a string and a character is that a string is a collection of characters, represented by an array of characters whereas a character is a single character. To make the above statement work writes the statement as shown below: strcat ( str, "!" ) ;

Comment(S)

Show all Coment

Leave a Comment




NCERT Solutions

 

Share your email for latest updates

Name:
Email:

Our partners