Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

What is preventing me from running this code?

#include <iostream>
#include <string>

void showResults(std::string* r);

int main()
{
std::string students[10] = { "1", "2", "3" };
std::string* r = students;

showResults(r);

system("pause >> null");
return 0;
}

 void showResults(std::string* r)​ {
 int i = 0;
 for (i; i < 10; i++)
{
    std::cout << *r << "\n";
    r++;
}
}

its giving me an error around the bottom function, but not saying what kind of error. I tried a lot of things myself, including different text editors, but nothing seems to work. Can anyone here help me?

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

everything is okay except there is a set of characters should be removed , kind of hidden encoded.

void showResults(std::string* r)​ {
......
}

before the first curly brace, remove that, In clion it show like like

void showResults(std::string* r)​​ZWSP{
......
}

enter image description here

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading