Login


Lost your password?

Don't have an account ?
Register (It's FREE) ×
  


Shop
CPP All : String Handling (Null Terminated)
Concept Learning Code Sheets

Check if string is a palindrome using a function. #1395

Check if a character array or c-style string is same (Palindrome) when reversed using an independent function.

String declaration and initialisation #2545

String declaration as character arrays an initialising them as individual character literals or as string literals.

Finding string length using the null finding technique #2551

Finding the length of an initialised character array or the c-style string using the null termination check.

Finding string length using the strlen() function #2556

Finding the length of an initialised character array or the c-style string using the strlen() function.

Getting string input from user using cin.getline #2560

Collecting string like input from the user which could be a full line.

Comparing length of two strings entered by the user #2565

A program to compare length of two strings entered by the user using cin.getline() and compared using strlen.

Comparing two strings for exact character wise match or for sort order using strcmp() #2571

A program to compare two strings entered by the user if their all characters are same or which string will come first in the sort order using the function strcmp(str1,str2)

gets() puts() string functions use and misuse #2606

Using gets() and puts() string function and its serious limitations

strcpy() and strcat() use in null terminated strings #2611

Use of functions strcpy() and strcat() on null terminated strings.

Reversing a null terminated string #2621

Reversing the original string given by the user and then printing it.


Solved Problems

Comparing two names for sort order #2577

Write a program using the strcmp() function to prove that the name RAKESH wi

Write a program using the strcmp() function to prove that the name RAKESH will come before the name RAMESH in an
ascending order sorted list.

First word of sentence (by individual character printing) #2594

Write a program to print the first word of a sentence given by the user.

Write a program to print the first word of a sentence given by the user.

First word of sentence (by creating another null terminated string) #2601

Write a program to print the first word of a sentence given by the user by cr

Write a program to print the first word of a sentence given by the user by creating another null terminated string.

count number of spaces in a given sentence #2614

Write a program  to count the number of space characters in a given input st

Write a program  to count the number of space characters in a given input string or sentence using the character match for space character ‘ ‘.

Change case of string input #2625

Write a program to get input of a string from the user as a character array a

Write a program to get input of a string from the user as a character array and then print the output with changed case from lower to upper and upper to lower for every character present in it. Do not taken any action if the character is not an alphabet, just print as it is.

Removing vowels from string #2628

Write a program to collect input sentence from user into a character array as

Write a program to collect input sentence from user into a character array as a null terminated string. Reprint the user given sentence after removing all the vowels. You can use switch case or if-else to check the vowel condition.

Word count assuming well formed sentence #2632

Write a program to count words in a given input sentence by a user, assuming

Write a program to count words in a given input sentence by a user, assuming that the sentence is well formed in a way that there are no initial or leading spaces and no extra spaces between words.

output writing example strcpy, strcat #2649

Write the output of the following program.

Write the output of the following program.

Character replacements in a string #2673

Write a c++ program to collect a small sentence from the user and then print

Write a c++ program to collect a small sentence from the user and then print the same sentence with all spaces replaced by hyphen (dash) character and all alphabets are replaced by their lower case counterparts.

Output Writing – isupper(), islower, isalpha() #2677

Write output of the following program.

Write output of the following program.

Counting words in a text input even if it is not well formed #2717

Write a program to count number of words even when there might be extra space

Write a program to count number of words even when there might be extra spaces between words and extra punctuation marks. Any alphabets or numbers written contiguously will be counted as words. For. e.g. “21st Century” are two words and “21    st         century systems ?” are four words. ? is not counted as word while 21 is counted as a word.

Find presence of a character in a null terminated string. #2840

Write a program to get a sentence from the user and then a single character f

Write a program to get a sentence from the user and then a single character from the user. Find if the character entered by the user is present in the given sentence or not.

Reversing each word in a sentence #3073

Write a program to take a sentence input from the user and then print the sen

Write a program to take a sentence input from the user and then print the sentence by reversing each word in the sentence.

Frequency of a given character in a sentence #3243

Write a program to input a small sentence from the user and ask about frequen

Write a program to input a small sentence from the user and ask about frequency of which character is to be found. Print how many times the character occurred in the given string. Do it for a a c-style (null-terminated string). Please note that the character frequency is to be found  irrespective of its lower or upper case.

Quizzes

Code Sheets:10  Solved Problems:14  Quizzes:2
×
Introductory Sessions Beginning to Program Tokens Keyword and Identifiers Data Types Variables and Constants Operators Simple User Input Building Expressions and Formulas Simple Real World Problems Simple If and If Else Multiple-Nested-Ladder of If Else Switch case selection Simple Loops Tricks in Loops - break continue scope Loop Applications - Handling numerals Series printing loops Nested Loops Pattern printing loops Number Varieties and Crunches String Handling (Null Terminated) Strings - string class type Functions (Built-in) Functions - user defined Functions Reference Passing/Returning Arrays Concepts and 1-D Arrays Array Data Management Two dimensional arrays and Matrices Structures Basics Structures passing/returning 2D Array Memory Addressing Display Using IO Manipulation Display Using C Formatting Tricks User Defined Data Types Enumerated Types Preprocessor Directives And Macros Exception Handling Programming Paradigms and OOPs Advantages Abstraction and Encapsulation Polymorphism Inheritance Function Overloading Concepts Function Overloading Varieties Function Overloading Special Cases Defining Classes Creating and Using Class Objects Class Members Accessibility Class Function Types Inline Functions Constant Functions Nesting of Functions Class Members Scope Resolution Static Members in a Class Array of Objects Constructor Concepts Default Constructor Parameterized Constructor Copy Constructor Constructor Overloading Destructors Inheritance Fundamentals Public Derivations Private and Protected Derivations Multiple Inheritance Multi-Level Inheritance Class Nesting Data File Concepts Handling Text Files Handling Binary Files Pointer Concepts Pointer and Arrays Pointers and Functions Object Pointers This Pointer Linked Lists Stacks Queues


Back