hello, i want to know how to separate the line because when i put my code between the code tag all code appear in the same line like thisCode:int main(){printf("hello world");}
hello, i want to know how to separate the line because when i put my code between the code tag all code appear in the same line like thisCode:int main(){printf("hello world");}
You have to press enter after each line. So it should look like this in the message field:
[code]
int main(void)
{printf("Hello world");}
[/code]
If you paste in the code you could try "Paste as plain text" (third icon in the first row in the enhanced message editor interface).
Bye, Andreas
thank you AndiPersti but even when i press enter after each line the code appear in the same line
Make sure you have javascript enabled (at least for cboard.cprogramming.com). Then check that the enter key on your keyboard works.
thank you grumpy but javascript enabled and the problem not solved
Are you using Internet Explorer?
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
I'm using google chrome
Okay, are you writing your code in a separate text editor, or in the textarea input provided by the forum software? If you are using a separate text editor, what is it? What operating system are you using?
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
I'm writing my code using textarea provided by the forum and i'm using linux ( debian)
Very interesting. Could you use a separate text editor, then copy and paste here to see if it makes a difference? If it doesn't, change the line endings to Windows style and try again.
Personally, I have never had a problem with posting multi-line code snippets here both on Windows 7 and various versions of Ubuntu Linux, but then I usually write my example code in a separate text editor (Geany).
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
using separate text editor it doesn't work and how i can change the line endings to windows style
Don't mean to be a pest, but how do you know it doesn't work by copy-pasting from a text editor? I don't see another post with code since you asked, nor an edit indication.
you can doing this with preview post
Probably stupid question, but are you able to write text on different lines, like:
Line 1
Line 2
Line 3
If so, what happens if you put the code-tags one line above and below? Does the preview still show just one line?
The reason for my question is that I've looked through some of your recent posts and you always write your messages in one long line. So show us that you can split your text into different lines.
Bye, Andreas
Different answers for different software... Maybe it would help to define what Windows style is. Windows uses CRLF which means that lines end in the characters \r\n, and there may be a setting indicating that's how the file is written. Linux flavors just use \n for line endings in files.