Frage

This challenge gets to to some of the subtle aspects of the C language. My first stab at this follows.

int main(int argc, char *argv[]) {
  int a,b,c,d,e,g,h,i;
  int f[1];
  double A,B,C,D,EFGHIJKLMNOPQRSTUVWXYZhijklmnopqrstuvwxyz_;
  // Following line is a line using many ASCII characters.  (Begins with a TAB)
    {a =!~(0*b%c^d&e+f[g]|h-i)?A:B>C,D<EFGHIJKLMNOPQRSTUVWXYZhijklmnopqrstuvwxyz_/1.23456789;}
  // Failed to use \ ` @ # $ " ' : and various control characters.
  return (0);
}

How can I use \ backquote @ # $ " ' : and maybe some more control characters?

Background: in creating code checkers and beautifiers, we run into various subtle C language issues. The above is a group self imposed exercise.

Note: ASCII is characters codes 0 - 127.
Note: Strings normally use pairs of quote marks and the line is limited to unique usages.

War es hilfreich?

Lösung

Perhaps you can put everything in a string, and go to the next line with a \ :

void main() {
  int a,b,c,d,e,g,h,i,f[1];
  double A,B,C,D,EFGHIJKLMNOPQRSTUVWXYZhijklmnopqrstuvwxyz_;
  // Following line is a line using many ASCII characters.  (Begins with a TAB)
    {a =!~(0*b%c^d&e+f[g]|h-i)?A:B>C,D<EFGHIJKLMNOPQRSTUVWXYZhijklmnopqrstuvwxyz_/1.23456789;}"'`@#$\
 ";
}
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top