Note that there are some explanatory texts on larger screens.

plurals
  1. POI have a issue with passing by reference using string
    primarykey
    data
    text
    <p>This is the question i am working on.</p> <p><em>"A simple encryption scheme named "rotate13" for encrypting text is to convert each letter (a…z or A...Z) to another letter by counting forward 13 letters, looping around from 'z' to 'a' or 'Z' back to 'A' if necessary. Write a function named rotate13 which takes a single null-terminated string as a parameter and converts it to its rotate13 equivalent. The function should modify the string directly, and it should not return anything. Remember, only letters should change; all other characters remain the same. You may assume that ctype.h is correctly included at the top of your program so that you can use any functions within the library if you wish. "</em></p> <p>And this is the error i keep getting </p> <pre><code>"error C2664: 'rotate13' : cannot convert parameter 1 from 'char (*)[10]' to 'char *[]'" </code></pre> <p>Thanks for the help. It will help me in my revisions for finals.</p> <pre><code>#include &lt;stdio.h&gt; #include &lt;stdlib.h&gt; #include &lt;ctype.h&gt; int rotate13(char *array[]); int size=10; int main() { char arr[10]; printf("Please enter the letters you wish to encrypt: "); scanf("%s",&amp;arr); printf("%s",arr); rotate13(&amp;arr); system ("pause"); return 0; } int rotate13(char *array[]) { int pointer; while(*array[pointer]!='\0') { if(isupper(*array[pointer])!=0) { if(*array[pointer]&lt;'N') *array[pointer]=*array[pointer]+13; else *array[pointer]=*array[pointer]-13; } else { if(*array[pointer]&lt;'n') *array[pointer]=*array[pointer]+13; else *array[pointer]=*array[pointer]-13; } pointer++; } printf("%s", *array); return 0; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload