Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the syntax of the following in c?

Tags:

c

fd1 = open("/dev/test_kft" "1",00);

What does "/dev/test_kft" "1" mean?

like image 249
mysql_go Avatar asked Mar 19 '11 06:03

mysql_go


2 Answers

It's implicit concatenation as performed by the compiler. It results in "/dev/test_kft1".

like image 88
Ignacio Vazquez-Abrams Avatar answered Sep 21 '22 10:09

Ignacio Vazquez-Abrams


The preprocessor concatenates adjacent string literals, so that line is the same as

fd1 = open("/dev/test_kft1", 00);

like image 33
tJener Avatar answered Sep 20 '22 10:09

tJener