100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Summary

Summary SCC 120 Strings Review

Rating
-
Sold
-
Pages
1
Uploaded on
20-08-2025
Written in
2022/2023

This is a comprehensive and detailed summary on; strings for SCC 120. An Essential Study resource just for YOU!!









Whoops! We can’t load your doc right now. Try again or contact support.

Document information

Uploaded on
August 20, 2025
Number of pages
1
Written in
2022/2023
Type
Summary

Content preview

Lecture 12: Strings
All data in is represented in a computer as binary. Characters are encoded into binary using
character sets such as ASCII, Extended ASCII or Unicode.

ASCII
Uses 7 bits to store all English characters (upper and lower case) as well as numbers, punctuation
and some control codes, which are mostly obsolete. Because ASCII uses 7 bits, it can easily be stored
within one byte.

Strings
Strings are an abstract data type that represent words. In reality, they are arrays of the characters
that make up the words. It is possible to compare strings by showing whether they are greater of
lesser than another string based on alphabetical order.

All strings end with a special byte, called the null byte. This signifies the end of a string and so means
that the array of characters assigned to a string will always be one greater in size than it seems it
should be. For example, “Hello World!” has 12 characters, but the character array would have 13
elements in.

Strings in C
In C, the library <string.h> provides functions for dealing with strings. In C, the compiler always
assumes that a string ends with a null byte (‘\0’).

strcpy(dest, txt) – copies the text in ‘txt’ to the variable in the ‘dest’ position.

strcat(txt1, txt2) – concatenates txt2 onto the end of txt1.

strlen(txt) – returns the number of characters in ‘txt’ excluding the null byte.

In C, comparing strings is not done by ‘string1 == string2’, instead the following can be used.

strcmp(txt1, txt2) – returns negative if txt1 is alphabetically smaller than txt2, zero if they are the
same and positive if txt1 is bigger than txt2.

strncmp(txt1, txt2, n) – compares the first ‘n’ characters of txt1 and txt2 in the same manner as
above.

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
anyiamgeorge19 Arizona State University
View profile
Follow You need to be logged in order to follow users or courses
Sold
60
Member since
2 year
Number of followers
16
Documents
7001
Last sold
2 weeks ago
Scholarshub

Scholarshub – Smarter Study, Better Grades! Tired of endless searching for quality study materials? ScholarsHub got you covered! We provide top-notch summaries, study guides, class notes, essays, MCQs, case studies, and practice resources designed to help you study smarter, not harder. Whether you’re prepping for an exam, writing a paper, or simply staying ahead, our resources make learning easier and more effective. No stress, just success! A big thank you goes to the many students from institutions and universities across the U.S. who have crafted and contributed these essential study materials. Their hard work makes this store possible. If you have any concerns about how your materials are being used on ScholarsHub, please don’t hesitate to reach out—we’d be glad to discuss and resolve the matter. Enjoyed our materials? Drop a review to let us know how we’re helping you! And don’t forget to spread the word to friends, family, and classmates—because great study resources are meant to be shared. Wishing y'all success in all your academic pursuits! ✌️

Read more Read less
3.4

5 reviews

5
2
4
0
3
2
2
0
1
1

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 exams and reviewed by others who've used these revision notes.

Didn't get what you expected? Choose another document

No problem! You can straightaway pick a different document that better suits what you're after.

Pay as you like, start learning straight 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 smashed it. It really can be that simple.”

Alisha Student

Frequently asked questions