Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include<string.h>
- using namespace std;
- void IdenficatorsToUpper(char *str)
- {
- if (str[0] >='a' && str[0]<='z')
- {
- int codeChar, codeInt;
- char upper;
- codeInt = static_cast<int>(str[0]);
- codeChar = codeInt - 32;
- upper = static_cast<char>(codeChar);
- str[0] = upper;
- for (int j = 0; j <= strlen(str); j++)
- {
- cout << str[j];
- }
- cout << endl;
- }
- else if (str[0]== '_')
- {
- cout << str << endl;
- }
- else
- {
- cout << str << endl;
- }
- }
- int main()
- {
- int bufferSize = 50;
- char *str = new char[bufferSize];
- cout << "Enter string: ";
- cin.getline(str, bufferSize);
- char arr[] = " ";
- char* ptr=strstr(str,arr);
- if (ptr==0)
- {
- IdenficatorsToUpper(str);
- }
- else
- {
- cout << "Wrong string\n";
- }
- delete[]str;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement