What does * mean in C programming?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

What does * mean in C programming?

Jump to solution
10,811 Views
admin
Specialist II

Hi. Below is a code to write characters to a LCD display. I would like to know what does the * mean. Thx

 

void lcd_string(byte line,byte *_data_buffer)
  {
     byte i;
     __RESET_WATCHDOG();
     if(line==1)
      {
        lcd_write_cmd(0x40); //DDRAM
        Check_LCD_Busy();//
        lcd_write_cmd(0x80); //CGRAM
        Check_LCD_Busy();
      }
      else
      {
        //lcd_write_cmd(0); //DDRAM
        lcd_write_cmd(60); //DDRAM
        Check_LCD_Busy();//
 
        lcd_write_cmd(0xc0); //CGRAM
        Check_LCD_Busy();//while((lcd_read_cmd()&0x80)==0x80);
      }
      
    for(i=0;i<LCD_16X2;i++)
    {
      if(_data_buffer[i]!=0)
      {
        lcd_write_data(_data_buffer[i]);
        Check_LCD_Busy();
      } else break;  
    }
  }

Message Edited by Cryptical on 2009-02-26 06:44 AM
Labels (1)
Tags (1)
0 Kudos
Reply
1 Solution
1,890 Views
bigmac
Specialist III

Hello,

 

The following is an example of using the function -

 

const byte str1[] = "The quick brown fox";

const byte str2[] = ...

 

...

 

void main(void)

{

 

...

lcd_string(1, str1);

 

The value of str1 is a pointer to the first element (character) of the array str1[].

 

Regards,

Mac

 

View solution in original post

0 Kudos
Reply
4 Replies
1,890 Views
PEBeginnerBeh
Contributor I
Yes, so the programm works.
0 Kudos
Reply
1,890 Views
admin
Specialist II

Thx for the reply. So i think the program above means writing a character to the first space of the LCD, and then points to the next space and repeats the process.

0 Kudos
Reply
1,890 Views
PEBeginnerBeh
Contributor I

Hi

 

I think  byte *_data_buffer defines a pointer wich has the range of a byte. * mean that the follow variable is define or use (for use it must be define befor) as a pointer.

Example:

 

char *test defines a pointer test with a rang from 0 to 255.

 

Message Edited by PEBeginner on 2009-02-26 09:25 AM
0 Kudos
Reply
1,891 Views
bigmac
Specialist III

Hello,

 

The following is an example of using the function -

 

const byte str1[] = "The quick brown fox";

const byte str2[] = ...

 

...

 

void main(void)

{

 

...

lcd_string(1, str1);

 

The value of str1 is a pointer to the first element (character) of the array str1[].

 

Regards,

Mac

 

0 Kudos
Reply