ATutor

Learning Management Tools







Pages:1 2 3 4 5 6 7 8 9 10 11 12 13 14 15


How to show arrayi in html


  • 2008-12-06 07:20:56

    How to show arrayi in html

    I have a C++ course and facing a problem in showing something like this in HTML output:

    int array[10];
    for (int i=0 ; i<10 ; ++i)
    cout << array[i];

    The problem is that in HTML output the [i] is omitted and the rest of text becomes italic. I know the problem is because [i] acts as <i> in HTML, but I don't know how to disable it. Any help would be appreciated!

  • 2008-12-06 08:21:09

    Re: How to show array[i] in html

    Use "add code" in the lower part of the content editor.

  • 2008-12-06 13:07:46

    Re: How to show array[i] in html

    Thanx!

    But the problem is that I have so many preformatted codes in HTML with lots of "<" and so on which when I use "add code" they appear as they are and I must change all of them by hand. Is there any other way (like escape codes in C/C++, for instance using \[ to show [)?

  • 2008-12-06 14:20:17

    Re: How to show array[i] in html

    You could try escaping, but I don't think so.

    A text editor, using search and replace.

  • 2008-12-08 02:56:17

    Re: How to show array[i] in html

    As far as I remember, one of the reasons behind removing emoticons bar during content editing was that it was breaking too much things in usual content. I guess that in the same spirit the support for anything but pure HTML has to be removed from HTML-formatted content.

    A quick look at the code didn't show me how to do that though: the formatting set in constants.inc.php seems to be not working for that item (or 'content.text' which I looked at is not what's needed here).

    For now, there's really no better solution than to replace right brackets with "& # 91;" (without quotes and spaces).