Question

How to deal with string manipulation in c++ without using built-in functions. how to return the...

How to deal with string manipulation in c++ without using built-in functions. how to return the array (1d or 2d) from functions in c++)?

0 0
Add a comment Improve this question Transcribed image text
Answer #1

String maniputlation can be done easily by using loops in C++

Just run the loop from index 0 until null is recieved

ex

for(int i=0;s[i]!='\0';i++)

//do what you want

To return the arrays we can use 1 of the 3 methods

1)Using dynamically allocated arrays - int* fun(int *arr) { return arr;}

2)using static array - int* fun(){static int a[100]; return a;}

3)using structures - use structure

PLEASE UPVOTE

Add a comment
Know the answer?
Add Answer to:
How to deal with string manipulation in c++ without using built-in functions. how to return the...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT