SlideShare a Scribd company logo
1 of 6
C Strings
7070905090
info@ducatindia.com
The one-dimensional range of characters is called strings, which is terminated by
a null personality ‘0’. A string is a one-dimensional array of characters in C
language. These are usually used to create meaningful and also understandable
programs.
For Example, The string “hello world” has 12 characters including ‘ 0’ character
which is automatically included by the compiler at the end of the string.
Declaring and Initializing a String variable
-To Declaration a string variable in C programming
Syntax: char name[x];
Where, the name is a variable name and x is
a size.
-To Initialize a string variable in C
Syntax: char name [x] = {a,b,c,….};
String Input and Output
Input function scanf() can be used with %s layout specifier to review a string
input from the incurable. There is one problem with scanf() function, it
terminates its input on the first white area it experiences. As a result, if you try to
read an input string “Hi World” utilizing scanf() function, it will only read Hello
there as well as end after encountering white spaces.
For Example:
Output:
String Handling Functions
C language supports several string handling that can be made use of to carry
out a number of the string adjustments. These functions are packaged in a
string.h library. Therefore, you need to include string.h header file in your
programs to make use of these functions.
There are the following String Handling Function:
7070905090
info@ducatindia.com

More Related Content

What's hot

T02 a firstcprogram
T02 a firstcprogramT02 a firstcprogram
T02 a firstcprogram
princepavan
 
Mesics lecture 5 input – output in ‘c’
Mesics lecture 5   input – output in ‘c’Mesics lecture 5   input – output in ‘c’
Mesics lecture 5 input – output in ‘c’
eShikshak
 

What's hot (20)

T02 a firstcprogram
T02 a firstcprogramT02 a firstcprogram
T02 a firstcprogram
 
CP Handout#7
CP Handout#7CP Handout#7
CP Handout#7
 
C language
C languageC language
C language
 
Basic Input and Output
Basic Input and OutputBasic Input and Output
Basic Input and Output
 
CP Handout#9
CP Handout#9CP Handout#9
CP Handout#9
 
COM1407: Input/ Output Functions
COM1407: Input/ Output FunctionsCOM1407: Input/ Output Functions
COM1407: Input/ Output Functions
 
C programming(Part 1)
C programming(Part 1)C programming(Part 1)
C programming(Part 1)
 
Programming in C (part 2)
Programming in C (part 2)Programming in C (part 2)
Programming in C (part 2)
 
Concepts of C [Module 2]
Concepts of C [Module 2]Concepts of C [Module 2]
Concepts of C [Module 2]
 
CP Handout#10
CP Handout#10CP Handout#10
CP Handout#10
 
Mesics lecture 5 input – output in ‘c’
Mesics lecture 5   input – output in ‘c’Mesics lecture 5   input – output in ‘c’
Mesics lecture 5 input – output in ‘c’
 
Basics of c++
Basics of c++Basics of c++
Basics of c++
 
C programming(part 3)
C programming(part 3)C programming(part 3)
C programming(part 3)
 
Beginner C++ easy slide and simple definition with questions
Beginner C++ easy slide and simple definition with questions Beginner C++ easy slide and simple definition with questions
Beginner C++ easy slide and simple definition with questions
 
Programming in C [Module One]
Programming in C [Module One]Programming in C [Module One]
Programming in C [Module One]
 
C formatted and unformatted input and output constructs
C  formatted and unformatted input and output constructsC  formatted and unformatted input and output constructs
C formatted and unformatted input and output constructs
 
Introduction to Input/Output Functions in C
Introduction to Input/Output Functions in CIntroduction to Input/Output Functions in C
Introduction to Input/Output Functions in C
 
Input And Output
 Input And Output Input And Output
Input And Output
 
C++ Tokens
C++ TokensC++ Tokens
C++ Tokens
 
CPU INPUT OUTPUT
CPU INPUT OUTPUT CPU INPUT OUTPUT
CPU INPUT OUTPUT
 

Similar to C strings

Similar to C strings (20)

[ITP - Lecture 17] Strings in C/C++
[ITP - Lecture 17] Strings in C/C++[ITP - Lecture 17] Strings in C/C++
[ITP - Lecture 17] Strings in C/C++
 
string in C
string in Cstring in C
string in C
 
C string
C stringC string
C string
 
String in c
String in cString in c
String in c
 
Lecture 05 2017
Lecture 05 2017Lecture 05 2017
Lecture 05 2017
 
COm1407: Character & Strings
COm1407: Character & StringsCOm1407: Character & Strings
COm1407: Character & Strings
 
MANAGING INPUT AND OUTPUT OPERATIONS IN C MRS.SOWMYA JYOTHI.pdf
MANAGING INPUT AND OUTPUT OPERATIONS IN C    MRS.SOWMYA JYOTHI.pdfMANAGING INPUT AND OUTPUT OPERATIONS IN C    MRS.SOWMYA JYOTHI.pdf
MANAGING INPUT AND OUTPUT OPERATIONS IN C MRS.SOWMYA JYOTHI.pdf
 
String in programming language in c or c++
 String in programming language  in c or c++  String in programming language  in c or c++
String in programming language in c or c++
 
Strings IN C
Strings IN CStrings IN C
Strings IN C
 
14 strings
14 strings14 strings
14 strings
 
String notes
String notesString notes
String notes
 
Unit 2- Module 2.pptx
Unit 2- Module 2.pptxUnit 2- Module 2.pptx
Unit 2- Module 2.pptx
 
Ch09
Ch09Ch09
Ch09
 
function, storage class and array and strings
 function, storage class and array and strings function, storage class and array and strings
function, storage class and array and strings
 
Mcai pic u 4 function, storage class and array and strings
Mcai pic u 4 function, storage class and array and stringsMcai pic u 4 function, storage class and array and strings
Mcai pic u 4 function, storage class and array and strings
 
Btech i pic u-4 function, storage class and array and strings
Btech i pic u-4 function, storage class and array and stringsBtech i pic u-4 function, storage class and array and strings
Btech i pic u-4 function, storage class and array and strings
 
Functions torage class and array and strings-
Functions torage class and array and strings-Functions torage class and array and strings-
Functions torage class and array and strings-
 
Diploma ii cfpc u-4 function, storage class and array and strings
Diploma ii  cfpc u-4 function, storage class and array and stringsDiploma ii  cfpc u-4 function, storage class and array and strings
Diploma ii cfpc u-4 function, storage class and array and strings
 
Strings
StringsStrings
Strings
 
Bsc cs i pic u-4 function, storage class and array and strings
Bsc cs i pic u-4 function, storage class and array and stringsBsc cs i pic u-4 function, storage class and array and strings
Bsc cs i pic u-4 function, storage class and array and strings
 

More from Ducat

More from Ducat (20)

Dot net training institute
Dot net training instituteDot net training institute
Dot net training institute
 
Mis certification
Mis certificationMis certification
Mis certification
 
Devops certification
Devops certificationDevops certification
Devops certification
 
Best ethical hacking course online
Best ethical hacking course onlineBest ethical hacking course online
Best ethical hacking course online
 
React js training course in noida
React js training course in noidaReact js training course in noida
React js training course in noida
 
Java for beginners
Java for beginnersJava for beginners
Java for beginners
 
Benfits of python
Benfits of pythonBenfits of python
Benfits of python
 
Interactive reports development
Interactive reports developmentInteractive reports development
Interactive reports development
 
Abap report
Abap reportAbap report
Abap report
 
Sap abap database table
Sap abap database tableSap abap database table
Sap abap database table
 
Sap s4 hana saps next generation business suite
Sap s4 hana saps next generation business suiteSap s4 hana saps next generation business suite
Sap s4 hana saps next generation business suite
 
Connect dashboard designer
Connect dashboard designerConnect dashboard designer
Connect dashboard designer
 
Major components of sap hana
Major components of sap hanaMajor components of sap hana
Major components of sap hana
 
Schema in sap hana
Schema in sap hanaSchema in sap hana
Schema in sap hana
 
Sap hana attribute view
Sap hana attribute viewSap hana attribute view
Sap hana attribute view
 
Sap hana studio administration console
Sap hana studio administration consoleSap hana studio administration console
Sap hana studio administration console
 
What is ebs
What is ebsWhat is ebs
What is ebs
 
Introduction to mern
Introduction to mernIntroduction to mern
Introduction to mern
 
Selenium tutorials
Selenium tutorialsSelenium tutorials
Selenium tutorials
 
Waits alerts and switch windows
Waits alerts and switch windowsWaits alerts and switch windows
Waits alerts and switch windows
 

Recently uploaded

The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
heathfieldcps1
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 

Recently uploaded (20)

Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptx
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 

C strings

  • 2. The one-dimensional range of characters is called strings, which is terminated by a null personality ‘0’. A string is a one-dimensional array of characters in C language. These are usually used to create meaningful and also understandable programs. For Example, The string “hello world” has 12 characters including ‘ 0’ character which is automatically included by the compiler at the end of the string. Declaring and Initializing a String variable -To Declaration a string variable in C programming Syntax: char name[x]; Where, the name is a variable name and x is a size. -To Initialize a string variable in C Syntax: char name [x] = {a,b,c,….};
  • 3. String Input and Output Input function scanf() can be used with %s layout specifier to review a string input from the incurable. There is one problem with scanf() function, it terminates its input on the first white area it experiences. As a result, if you try to read an input string “Hi World” utilizing scanf() function, it will only read Hello there as well as end after encountering white spaces. For Example:
  • 4. Output: String Handling Functions C language supports several string handling that can be made use of to carry out a number of the string adjustments. These functions are packaged in a string.h library. Therefore, you need to include string.h header file in your programs to make use of these functions.
  • 5. There are the following String Handling Function: