问题描述
我有兴趣知道是否有办法在C中的多行使用变量名分割
。
。对于例如:
INT this_is_a_very_long_variable_name = 10;
我想分裂" this_is_a_very_long_variable_name "进入2
行 - 让我们说this_is_a_在第一行和
" very_long_variable_name"在第二行。
这可能在语法上用C吗?
我尝试使用反斜杠操作符是徒劳的:
int this_is_a_ \
very_long_variable_name = 10;
上面给出了编译错误。
如果有的话,请提供相应的方法。
谢谢,
Sriram。
Hi,
I was interested to know if there is a way to use a variable name split
across multiple lines in C.
For example :
int this_is_a_very_long_variable_name = 10;
I would like to split the "this_is_a_very_long_variable_name " into 2
lines - lets say "this_is_a_" in the first line and
"very_long_variable_name " in the second line.
Is this possible syntactically in C?
I tried using the backslash operator in vain :
int this_is_a_\
very_long_variable_name = 10;
The above gives a compilation error.
Please suggest the means to do this if there is any.
Thanks,
Sriram.
推荐答案
没有。
我我很好奇你正在做什么需要这个。
-
Chris" hantwig efferko VOOM! Dollin
你是谁?你想要什么? / Babylon 5 /
There isn''t.
I''m curious as to what you''re doing that needs this.
--
Chris "hantwig efferko VOOM!" Dollin
"Who are you? What do you want?" /Babylon 5/
在\\ _
之后,不要在very_long_name之前放置任何空白或标签,不要放任何空格或标签;
ex:
int this_is_a_\
very_long_variable_name = 10;
HTH,
Loic。
don''t put any blank or tab after the \
don''t put any blank or tab before "very_long_name"
ex:
int this_is_a_\
very_long_variable_name = 10;
HTH,
Loic.
int this_is_a_ \
very_long_variable_name
尝试时不允许缩进在
中间拆分一个令牌,因为\在换行后不会吃除
以外的任何空格。
int this_is_a_\
very_long_variable_name
No indentation is permitted when you are attempting to split a token in
the middle, since \ does not eat any whitespace other than the
immediately following newline.
这篇关于变量名的语法跨越C中的多行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!