Hello, I am new guy in here and I am learning how to use a C++, but I have problems.
How to use this and make them work in C++ language, but not written in C language.
#include<iostream>
#include<stdio.h>
#include<ctype.h>
using namespace std;
int main()
{
char str[]="ThiS line Will be wiTh low aNd cApiTal type cHaracTers\n";
char *p;
printf("This line will be with low type characters: \n");
p=str;
while (*p)
printf("%c", tolower(*p++));
cin.get();
return 0;
}
You mean, how to use iostream ? printf("This line will be with low type characters: \n"); becomes cout << "This line will be with low type characters: \n";. printf("%c", tolower(*p++)); becomes cout << char(tolower(*p++));//tolower for some reason returns an int, so to see a char, we have to convert it to char