CSC 270 – Survey of Programming Languages C Lecture 4 – Strings Heavily borrowed from Dr. Robert Siegfried and Dietel How to Program in C Powerpoint Presentations
C-String Values • The most basic way to represent a string of characters in C is using an array of characters that ends with a null byte. • Compiler will put a null at the end of a quoted string constant – but nothing else • C Standard library has many string functions in string. h • Example printf("Hello"); H e l l o
C-String Variables • A C-string variable is an array of characters that is expected to be terminated with a null byte ('