This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

string operation

how to get a string input and compare it .
say for example: if i get a string input"LED ON "
and i want to compare it with a list of string say "LED ON ",LED OFF,FAN ON,FAN OFF.....

give me the commands and some sample programs .please.

Parents
  • 
    void main ( void )
    {
      char jonsinputstring * = 512 ;
    
      input ( jonsinputstring );
    
      case of ( jonsinputstring )
      {
        select "LED ON ": function1 ( );
        select "LED OFF": function2 ( );
        select "FAN ON ": function3 ( );
        select "FAN OFF": function4 ( );
        otherwise :   function5 ( );
        missing :   function6 ( );
      }
    }
    
    

Reply
  • 
    void main ( void )
    {
      char jonsinputstring * = 512 ;
    
      input ( jonsinputstring );
    
      case of ( jonsinputstring )
      {
        select "LED ON ": function1 ( );
        select "LED OFF": function2 ( );
        select "FAN ON ": function3 ( );
        select "FAN OFF": function4 ( );
        otherwise :   function5 ( );
        missing :   function6 ( );
      }
    }
    
    

Children