我正在尝试自己学习C,我有点困惑getchar和putchar:
#include <stdio.h>
int main(void)
{
char c;
printf("Enter characters : ");
while((c = getchar()) != EOF){
putchar(c);
}
return 0;
}
Run Code Online (Sandbox Code Playgroud)
#include <stdio.h>
int main(void)
{
int c;
printf("Enter characters : ");
while((c = getchar()) != EOF){
putchar(c);
}
return 0;
}
Run Code Online (Sandbox Code Playgroud)
C库函数int putchar(int c)将参数char指定的字符(unsigned char)写入stdout.
C库函数int getchar(void)从stdin获取一个字符(一个unsigned char).这相当于以stdin作为参数的getc.
这是否意味着putchar()同时接受int和char或其中一方以及getchar()我们应该使用一个int或char?
我有FullCalendar启动并运行它非常好.我的问题是如何最好地实现时隙悬停功能.如果用户可以为他们悬停的任何给定时间段提供视觉提示,那将是非常好的.
我找到了以下链接http://code.google.com/p/fullcalendar/issues/detail?id=269,它提供了一个解决方案,在议程单元格行中添加新结构,以便提供对单个单元格的访问.但是,表明此解决方案将导致FullCalendar变得迟缓.
在我开始研究FullCalendar代码之前,我想我会问其他人是否有任何想法或解决方案.
我对此的看法如下:
将占位符事件添加到每个时间段.用户不会看到这些事件,但这些不可见事件可用于允许"悬停"标记.我担心的是,添加额外的事件会导致FullCalander变得迟钝.此外,拖放功能可能会受到影响.
FullCalender可以确定用户点击的时间段.是否可以使用获取点击时间段的代码,以便为悬停突出显示提供参考?
其他?
我正在考虑选项2作为开始的地方.但是,如果有人对可行的解决方案有另一个想法,我会很高兴听到它.
如果我想出一个解决方案,我会在这里发布.
谢谢,
吉姆
这是FullCalendar网站的链接:http://fullcalendar.io/
我发现它非常好用.
我目前正在使用"react-router": "^2.4.0"我的聊天应用程序,并且在没有用户时如何重定向感到困惑.我不认为重定向的作品"^2.4.0".
我应该onEnter在聊天路径上使用挂钩吗?
像这样的东西:
<Route path="chat" component={Chat} onEnter={Chat.willTransitionTo}/>
Run Code Online (Sandbox Code Playgroud)
routes.js
<Route path="/" component={App} >
<IndexRoute component={Chat} />
<Route path="chat" component={Chat} />
<Route path="login" component={Login} />
</Route>
Run Code Online (Sandbox Code Playgroud)
Chat.jsx
static willTransitionTo(transition){
var state = ChatStore.getState();
if(!state.user){
transition.redirect('/login');
}
}
Run Code Online (Sandbox Code Playgroud)