I'm doing some coding in C++
Want to have a long empty string like below
const char ModMisfit :: DelStr[] = "\r \r";
However due to the long blank the line is very long. Is there any way to avoid this and keep the code width to around 80 characters.
kristinu:
I'm doing some coding in C++
Want to have a long empty string like below
const char ModMisfit :: DelStr[] = "\r \r";
However due to the long blank the line is very long. Is there any way to avoid this and keep the code width to around 80 characters.
Hello
why dont you do a simple
char foo[80]={0}; //initialize all to 0s
How about the \r. I am trying to write some stuff on the terminal when I run the program but then gets removed.
---------- Post updated at 04:20 PM ---------- Previous update was at 04:13 PM ----------
Doing just like that did not work
I intend to first do
cerr << "info";
then
cerr << DelStr;
to remove what was written.
How about this:
#include <stdio.h>
int
main()
{
char s[] = "Really "
"long "
"string ";
printf("s = %s\n", s);
}
Here is a quote from KnR:
Does this help ?
With regard to the OP:
#include <stdio.h>
int main()
{
char *a="12345678"
"9 10 11 12";
printf("%s\n", a);
return 0;
}
is a feature of C for the very problem the OP stated.
const char ModMisfit :: DelStr[]
= "\r "
" \r";
Oddball features like this, trigraphs, and alternate tokens (C++ only) that relate to keyboard and console limitations exist mainly so that you can enter and read source on an old tty ~ the ones with limited keyboards, and limited "terminal" width - usually a piece of paper.