Bug? in Modifying Array Elements



I got this error all the time: Oops, try again. It looks like you didn't print 'Advanced C ' (the element you modified)!

But that's the item I'm modifying, so I don't know why I get this error...

I hope someone can help me with this, because it's a bit frustrated...

    <title>Modifying Elements</title>
        $languages = array("HTML/CSS",
        "JavaScript", "PHP", "Python", "Ruby");
        $languages{1} = "Advanced C" ;
        echo $languages[1] ;
        // Write the code to modify
        // the $languages array!


I found the error, reading previous posts of errors.

It only works if you choose as new language "C++"


Hi @humbertova,

If you have time, go back and try your "Advanced C" again, but this time close up the extra spaces that you have left just before your ;.


I just did what you told me and now if works with the word "Advanced C";

I'm going to try to use the semicolons without any space between the text and the ";" but I'm not sure this is a rule.

Sometimes the interpreter just freezes and I don't understand why.

Anyway, thanks for answering because I was saying something wrong. It works also with some other words different from "C++"


I don't think it is a rule in real life coding but more a matter of what exactly this code checker is looking to find. I think it looks better without the space though. :slight_smile:


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.