Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Class notes

String Basics

Rating
-
Sold
-
Pages
100
Uploaded on
14-05-2023
Written in
2022/2023

• What are Strings • More about Strings • Pointers and Strings • Standard Library String Functions strlen( ) strcpy( ) strcat( ) strcmp( ) • Two-Dimensional Array of Characters • Array of Pointers to Strings • Limitation of Array of Pointers to Strings

Show more Read less
Institution
Course

Content preview

SRM INSTITUTE OF SCIENCE AND
TECHNOLOGY,
CHENNAI.
18CSS101J – Programming for ProblemSolving
Unit III
18CSS101J –Programming for Problem Solving
Unit III

, SRM INSTITUTE OF SCIENCE AND
TECHNOLOGY,
CHENNAI.
Unit III: Content
String Basics – String Declaration and Initialization – String Functions:
gets(), puts(), getchar(), putchar(), printf() - String Functions: atoi,
strlen, strcat strcmp – String Functions: sprintf, sscanf, strrev, strcpy,
strstr, strtok – Arithmetic characters on strings.

,STRING BASICS
● Strings in C are represented by arrays of characters.

● String is nothing but the collection of the individual array elements
or characters stored at contiguous memory locations

i) Character array – 'P','P','S'

ii) Double quotes - “PPS" is a example of String.

− If string contains the double quote as part of string then we can
use escape character to keep double quote as a part of string.
− “PP\S" is a example of String

, iii) Null Character
− The end of the string is marked with a special character, the null
character, which is a character all of whose bits are zero i.e., a
NULL.
− String always Terminated with NULL Character (‘/0′)
char name[10] = {'P','P','S','\0'}
● NULL Character is having ASCII value 0
● ASCII Value of '\0' = 0
● As String is nothing but an array , so it is Possible to
Access Individual Character
name[10] = "PPS";
− It is possible to access individual character
name[0] = 'P';
name[1] = 'P';
name[2] = 'S';
name[3] = '\0';

Connected book

Written for

Institution
Course

Document information

Uploaded on
May 14, 2023
Number of pages
100
Written in
2022/2023
Type
Class notes
Professor(s)
Saad sait
Contains
All classes

Subjects

$8.99
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
thedevil

Get to know the seller

Seller avatar
thedevil DAV Boys
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
3 year
Number of followers
0
Documents
1
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions