Is dest a char pointer? If so then dest[i] is a single character and needs %c not %s. Characters are basically integers with a more limited range which is why you get the "argument 2 has type 'int'" part of the error message.
"Owners of dogs will have noticed that, if you provide them with food and water and shelter and affection, they will think you are god. Whereas owners of cats are compelled to realize that, if you provide them with food and water and shelter and affection, they draw the conclusion that they are gods."
-Christopher Hitchens
i have got it almost working, my output is just a bit weird, im gonna stop posting my code in case other students in my class start using my code as well, most of the code from my previous posts has changed a lot in order to get it working.
i wish there was a way for me to show you my code because im getting such a weird output, i know it must be a math error somewhere but i just can't find it, thanks for all the help everyone i have learned a lot today
Your output errors are probably because you're trying to print your values as strings, when they aren't strings. Your fake strings aren't null terminated. That means you can't use any normal string functions on them.
Quzah.
Hope is the first step on the road to disappointment.
well my output is
supposed to beCode:1 0 -1 helloworlo
im not understanding where i went wrongCode:1 0 -1 hello world
You didn't add 1. You're adding to the end of the string, which means you're starting at 7, not 6.
Quzah.
Hope is the first step on the road to disappointment.
i think my ps_set is wrong because i just added a printf statement to tell me the length
and "hello " = 6
and "world\n" = 6
but world is only supposed to be 5 :S
Why is it only supposed to be five? "world\n" has six characters.
Quzah.
Hope is the first step on the road to disappointment.
because \n is an escape key
w = 1
o = 2
r = 3
l = 4
d = 5
\n = 6
Where are you confused? Unless your set function is designed to treat \n as the end of a string, which it shouldn't, because otherwise 'hello ' should have kept on checking for more letters, then \n is just another regular character.
Quzah.
Hope is the first step on the road to disappointment.