Printf() func. In main C | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Printf() func. In main C

I am trying to encrypt a message and calculate it from a seperate function with pointers to the message in the main(). Having declared an output array in main for the message to store and call within side the function and return a void function with the encrypted calculation. However instead of printing the message inside the function, how can I print the encrypted message inside the main after the function has been called?

23rd Apr 2020, 4:36 AM
Becca
Becca - avatar
2 Answers
+ 1
ah ok make sense , so if I undertand it correctly, say if the user inputs a plain text, only the inputed text is passed as a pointer to the function to encrypt the message, then the second pointer stores the encrypted in the char array which then main() can print the encrypted message?
23rd Apr 2020, 6:16 AM
Becca
Becca - avatar
+ 1
ah ok great! Thanks so much for your help!
23rd Apr 2020, 2:23 PM
Becca
Becca - avatar