Thread: Unknown symbol.

  1. #1
    Registered User
    Join Date
    Apr 2020
    Posts
    62

    Unknown symbol.

    What does $> symbolize?

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    I don't think that's a valid symbol in C. You might be looking at someone's attempt to tell you that whatever comes next should be run at the command line.

    If you don't understand what I just wrote, show an example in which you saw this symbol being used.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Registered User
    Join Date
    May 2012
    Posts
    505
    The dollar sign doesn't appear as a token or part of a token in C. Probably because it might not be available in a non-American context. You do see it sometimes as an extension, but I'd agree that $> looks like an input prompt.
    I'm the author of MiniBasic: How to write a script interpreter and Basic Algorithms
    Visit my website for lots of associated C programming resources.
    https://github.com/MalcolmMcLean


  4. #4
    Registered User Sir Galahad's Avatar
    Join Date
    Nov 2016
    Location
    The Round Table
    Posts
    277
    Quote Originally Posted by Malcolm McLean View Post
    The dollar sign doesn't appear as a token or part of a token in C. Probably because it might not be available in a non-American context. You do see it sometimes as an extension, but I'd agree that $> looks like an input prompt.
    No?

    Code:
    int main(void)
    {
     int $ = 0;
    }

  5. #5
    Registered User rstanley's Avatar
    Join Date
    Jun 2014
    Location
    New York, NY
    Posts
    1,110
    Quote Originally Posted by Sir Galahad View Post
    No?

    Code:
    int main(void)
    {
     int $ = 0;
    }
    Your code above won't even compile;

    Please format your code with proper indentation. This is not a C Code Obfuscation contest.

    Your if else statement is illegal.
    Code:
    #include <stdio.h>
    #include <stdlib.h>
    #include <time.h>
    #include <math.h>
    
    long x(long y,long z)
    {
       if(!z)
          return y;
       return x(z,y%z);
    }
    
    int main(void)
    {
       long t,u,w=0,v=0;
    
       srand(time(0));
    
       for(;;)
       {
          t=rand();
          u=rand();
    
          if(x(t,u)-1);
          else
             ++v;
    
          system("clear") && system("cls");
          printf("\n\n\n %g\n\n\n",1/sqrt(((double)v)/((3<<1)*++w)));
       }
    }

  6. #6
    Registered User Sir Galahad's Avatar
    Join Date
    Nov 2016
    Location
    The Round Table
    Posts
    277
    Quote Originally Posted by rstanley View Post
    Your code above won't even compile;

    Please format your code with proper indentation. This is not a C Code Obfuscation contest.

    Your if else statement is illegal.
    Code:
    #include <stdio.h>
    #include <stdlib.h>
    #include <time.h>
    #include <math.h>
    
    long x(long y,long z)
    {
       if(!z)
          return y;
       return x(z,y%z);
    }
    
    int main(void)
    {
       long t,u,w=0,v=0;
    
       srand(time(0));
    
       for(;;)
       {
          t=rand();
          u=rand();
    
          if(x(t,u)-1);
          else
             ++v;
    
          system("clear") && system("cls");
          printf("\n\n\n %g\n\n\n",1/sqrt(((double)v)/((3<<1)*++w)));
       }
    }
    The code at the bottom is my signature. And both compile just fine (tested with gcc and clang on linux).

  7. #7
    Registered User
    Join Date
    May 2012
    Posts
    505
    Quote Originally Posted by Sir Galahad View Post
    No?

    Code:
    int main(void)
    {
     int $ = 0;
    }
    That's an extension. Some compiler will accept dollar signs in identifiers, but some won't.
    It's quite useful actually as it creates a namespace which cannot clash with conforming, portable code.
    I'm the author of MiniBasic: How to write a script interpreter and Basic Algorithms
    Visit my website for lots of associated C programming resources.
    https://github.com/MalcolmMcLean


  8. #8
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Quote Originally Posted by Sir Galahad View Post
    No?

    Code:
    int main(void)
    {
     int $ = 0;
    }
    According to C11, you're relying on "other implementation-defined characters", since $ is not in the list of non-digits and does not have the form of a universal character name. Anyway, it is irrelevant because TheGreekMan2000 asked about $> rather than just $
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  9. #9
    Registered User Sir Galahad's Avatar
    Join Date
    Nov 2016
    Location
    The Round Table
    Posts
    277
    Quote Originally Posted by Malcolm McLean View Post
    That's an extension. Some compiler will accept dollar signs in identifiers, but some won't.
    It's quite useful actually as it creates a namespace which cannot clash with conforming, portable code.
    Oh okay. Kind of annoying that a compiler would support an extension by default though. Code would be way more portable if that sort of thing would raise an error/warning instead.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 12
    Last Post: 02-20-2017, 04:57 PM
  2. Replies: 2
    Last Post: 01-10-2012, 08:49 PM
  3. how to identify "Unknown Symbol"
    By MK27 in forum Linux Programming
    Replies: 6
    Last Post: 05-11-2009, 08:50 AM
  4. ~ symbol
    By vurentjie in forum C Programming
    Replies: 2
    Last Post: 06-02-2008, 03:20 AM
  5. What does this symbol mean: ->
    By deregistered in forum C Programming
    Replies: 10
    Last Post: 01-02-2002, 01:45 PM

Tags for this Thread