How to copy string from one vector to another vector in C?

Asked

Viewed 39 times

0

I’m trying to create a program that will have a function called substring where the user will place the index position of an origin vector in which it will copy and the size of how many letters it will copy from this vector.

Example :

vetor_origem = "algoritmo"

substring(0,4) -- > "algo"

That is, I want the user to put the size of how much he wants to copy and from a position of the index, I already took a look at some other places, but I could not play right in the code.

But for this, I don’t know how I can go on. How can I do this ?

  • But I need that before the copy has user input, the other questions do not have user input, they already come with a predefined value.

  • Example tested: https://pastebin.com/vp48Hizz

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.