我似乎无法解决问题.我错过了什么?
考虑以下
int main(int argc, char *argv[]) {
while ( *argv ) {
printf("argv[] is: %s\n", *argv);
++argv;
}
return 0;
}
Run Code Online (Sandbox Code Playgroud)
这会打印出argv的每个值.所以命令行如./example arg1 arg2输出以下内容:
`argv[] is: ./example`
`argv[] is: arg1`
`argv[] is: arg2`
Run Code Online (Sandbox Code Playgroud)
现在考虑以下(我遇到麻烦):
int main(void) {
char *days[] = {
"Sunday",
"Monday",
"Tuesday"
};
while ( *days ) {
printf("day is %s\n", *days);
*days++;
}
return 0;
}
Run Code Online (Sandbox Code Playgroud)
如果我尝试编译,我会收到错误 cannot increment value of type 'char *[3]'
如果我改变*days++到(*days)++它编译.如果我运行它,它会永远运行并最终失败bus error.
但是,它不会遍历每个值days[] …
好,
所以我有一个<figure>元素,我想transform: scale(1.2)在开启时使用:hover.
除了一个问题,它工作正常:左边重叠很好,右边保留在下一个元素下面.
这是JsFiddle
如您所见,左侧与前一个元素重叠,右侧"重叠"下一个元素.
这是html
<section class="list-cover">
<figure>
<a href="" title="">
<img src="http://ia.media-imdb.com/images/M/MV5BMTk0NDg4NjQ5N15BMl5BanBnXkFtZTgwMzkzNTgyMTE@._V1_SX214_AL_.jpg" alt="" />
<figcaption>Caption Text</figcaption>
</a>
</figure>
<figure>
<a href="" title="">
<img src="http://ia.media-imdb.com/images/M/MV5BMjAyMDM2ODExNF5BMl5BanBnXkFtZTgwNTI2MjkzMTE@._V1_SY317_CR9,0,214,317_AL_.jpg" alt="" />
<figcaption>Caption Text</figcaption>
</a>
</figure>
<figure>
<a href="" title="">
<img src="http://ia.media-imdb.com/images/M/MV5BMjIzMjgwMTQzMV5BMl5BanBnXkFtZTgwNDcyMjczMTE@._V1_SY317_CR0,0,214,317_AL_.jpg" alt="" />
<figcaption>Caption Text</figcaption>
</a>
</figure>
<figure>
<a href="" title="">
<img src="http://ia.media-imdb.com/images/M/MV5BMTg1MTIwODYwMl5BMl5BanBnXkFtZTgwNjAwNzQzMTE@._V1_SY317_CR2,0,214,317_AL_.jpg" alt="" />
<figcaption>Caption Text</figcaption>
</a>
</figure>
<figure>
<a href="" title="">
<img src="http://ia.media-imdb.com/images/M/MV5BMTgzNjQ4NjM1NF5BMl5BanBnXkFtZTcwNzQ4OTEzNw@@._V1_SY317_CR11,0,214,317_AL_.jpg" alt="" />
<figcaption>Caption Text</figcaption>
</a>
</figure>
</section>
Run Code Online (Sandbox Code Playgroud)
这是CSS:
.list-cover figure …Run Code Online (Sandbox Code Playgroud) 是否可以通过 Post/Get 传递 Null 值?
通过 null,我的意思是在 上返回 trueisset()但在 上返回false 的东西empty()。
原因是,我想知道我是否需要额外检查$_GET我在哪里检查以下内容:
if (isset() && !empty()) {
// do stuff
} elseif (isset() && empty()) { // In other words, omit this one.
// do other stuff
} else {
//foo bar
}
Run Code Online (Sandbox Code Playgroud)
谢谢,