Ask a question from expert

Ask now

OOPS Concepts: C++

Build a console application in C++ language to accept a string from the user, reverse it, and identify vulnerabilities in the string manipulation.

10 Pages1216 Words314 Views
   

Added on  2022-11-16

About This Document

Learn about OOPS concepts in C++ with solved assignments, essays, and dissertations. Get a program analysis of string input console application and its vulnerabilities.

OOPS Concepts: C++

Build a console application in C++ language to accept a string from the user, reverse it, and identify vulnerabilities in the string manipulation.

   Added on 2022-11-16

BookmarkShareRelated Documents
Running head: OOPS CONCEPTS: C++
OOPs concepts: C++
Name of the Student
Name of the Course
Instructor
Date
OOPS Concepts: C++_1
OOPS CONCEPTS: C++1
String Input Console Application and Program Analysis (#1)
Introduction
C++ is an object oriented approach for programming where the name clearly suggests
that it uses objects. The C++ is an extension of C program where the OOPs concept is included.
It is developed by Bjarne stroutstrup at bell labs (Stroustrup, 2013). As it is known that OOPs
has six major characteristics named polymorphism, inheritance, abstraction, encapsulation, class
and objects. A class is consist with several objects, functions and data variables. The analysis of
advantages and concepts of using C++ along with string operation, its vulnerabilities and ideal
solutions has been done here using C++ compiler.
Program: (String Reverse)
#include <iostream>
#include <cstring>
using namespace std;
//Function will count and return the length if the string
int find_length(char string_input[]){
//Declaring the variables
int counter;
//Counting the the length of the string
for(counter=0;string_input[counter]!='\0';++counter);
OOPS Concepts: C++_2
OOPS CONCEPTS: C++2
//returns the counted length
return counter;
}
//Function Will reverse the string
void reverse_string(char string_input[],int length){
//Declaring the variables
int i,counter = length - 1;
char reversed_string[100];
//Reversing the string using loops
for(i = 0;i < length;i++){
reversed_string[i] = string_input[counter];
counter--;
}
reversed_string[i] = '\0';
//Printing the reversed string
cout<<"String after reversing: "<<reversed_string;
OOPS Concepts: C++_3

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents
new features of this C++ programming
|12
|1032
|16

Organizing Input Output in a Programming Language
|11
|3656
|107

ROBOTICS C++. 1. Robotics C++ Name of Student Instituti
|5
|482
|24

Error Checking And Handling
|12
|2453
|21

Squential Search and Sorting Algorithms in C++
|2
|251
|292

Employee Salary Calculator
|8
|1084
|42