Sunday, 21 January 2018

Putting Strings Together


Putting Strings Together

Putting Strings Together
We cannot assign one string to another directly We cannot join two strings together by the simple arithmetic addition.
       string3 = string1+string2;
       string3 = string1+'hello";   are not valid.
The characters from string1 and string2 should be copied into the string3 one after the other.The size of string3 should be large enough to hold the total characters.The process of combining two strings together is called concatenation.'C' does not permit the comparison of two strings directly.
               if(name1==name2)
               if(name==''ABC") are not valid.
It is therefore necessary to compare the two strings to be tested , character by character.
The comparison is done until there is a mismatch or one of the string terminates into a null character, whichever occurs first.

Related Posts:

  • Enumerated Data Type Enumerated Data Type     This is one of the user defined datatypes. The use of this datatype is to make programs more readable.It allows you to create your own datatype with predefined values. Though its form … Read More
  • Difference Between The Macros And Functions Difference Between The Macros And Functions Macros are like functions but there is difference between those two . 1. In macro call the processor replaces the macro template with its macro expansion. Where as in functi… Read More
  • Unions Unions  As array represent group of data items that belong to the same type. C supports  a  constructed data type known as structure and unino, which are methods for packing data of different types. … Read More
  • Defining And Opening A File Defining And Opening A File  If we want to store data in a file in the secondary memory, we must specify certain things about the file , to the operating system. They include:  1.File name.  2.Data Structu… Read More
  • Inroduction To PreProcessors Inroduction To PreProcessors INTRODUCTION:     The C preprocessor is a program that processes our source program before it is passed to the compiler.This is a  capability that does not exist in many other … Read More

0 comments:

Post a Comment