Write a function thats called trimfrnt() that deletes all leading blanks from a
ID: 3637418 • Letter: W
Question
Write a function thats called trimfrnt() that deletes all leading blanks from a string. write this function using pointers with the return type void. The solution I come up with listed below, states I have an error in my programming?!? I’m having issues finding the error, please assist me, thanks…#include <iostream>
using namespace std;
void trimfrnt(char *strng);
int main()
{
int i = 0;
int len = 0;
len = strlen(strng);
i = len - 1;
while (*(strng + i) && *(strng + i) == ' ')
i--;
len = i + 1;
*(strng + len) = '';
return;
}
Explanation / Answer
#include #include #include using namespace std; void trimfrnt(char *strng) { char temp[100]; int i; int count = 0; int len = 0; len = strlen(strng); for(i = 0;iRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.