void z()
{
delay(25);
}
int main()
{
///some codes here
{
char x[]="Show this text slowly";
for (int i=0;i<sizeof(x);i++) ///i want this part to be a function
{
cout<< x [i]; ///up until here
z();
}
}
so is it possible?or is there any other way to do something just like that?
i have like 100+ lines to write :'(
void printChar(char arr[], int temp)
{
for (int i=0;i<temp;i++)
{
cout<< arr[i];
}
}
int main()
{
char x[]="Show this text slowly";
printChar(x,sizeof(x));
}
You can pass the array and its size to a function and let it print out that array.
I don't see how that makes any difference to a number of lines you are supposed to write though.