Hello, I have been having some difficulty finding the answer to creating your own simple function which is comprised of a few standard functions doing things in a way that is acceptable. What I am looking to do is creat a function that can be inserted into other functions that do standard things like the printf function. For example:
printf ("character:""%c\n",sc);
uses variable sc. I would like to be able to replace this with:
printf ("character:""%c\n",myfunction(sc));
so that what printf returns is the "modified" variable sc from what myfunction has done to it. So that you know, I am simply using the memset function to set the first character of sc after using a count from the strchr function.
I asked this elsewhere and have gotten very short and unhelpful and rude responses. I am new to c++ programming and I'm not in school doing homework. I would like to find some input of how to properly structure my new function so that it can be used the way I intend. The requirement that I'm looking for is to be able to use my function in the place of a variable in where the function, myfunction(sc) can be used as myfunction(other_variables) to do the same thing. I'm having difficulty finding an example of how I can do this. Any help is certainly appreciated.
Thank you.