C Programming: String

Press Bangladesh

String: In C programming, a string is a sequence of characters terminated with a null character . Example: char c[] = “bangladesh”; How to declare a string? Here’s how you can declare strings: char s[5]; How to initialize strings? You can initialize strings in a number of ways. char c[] = “abcd”; char c[50] = “abcd”; char c[] = {‘a’, ‘b’, ‘c’, ‘d’, ‘’}; char c[5] = {‘a’, ‘b’, ‘c’, ‘d’, ‘’}; Assigning Values to Strings Arrays and strings are second-class citizens in C; they do not support the assignment…

Read More