如何解决getmaxyx如何更改传递的变量的值?
class QuestionBankIndex(indexes.SearchIndex,indexes.Indexable):
text = indexes.CharField(document=True,use_template=True,template_name='search/question_bank_text.txt')
question_id = indexes.IntegerField(model_attr='id')
owner = indexes.CharField(model_attr='owner',null=True)
def get_model(self):
return QuestionBank
def index_queryset(self,using=None):
return self.get_model().objects.filter(active=True)
结果是
宽度:148
高度:38
如何在不传递指针的情况下更改宽度和高度
解决方法
如果您阅读https://linux.die.net/man/3/getmaxyx,将会看到:
,说明所有这些接口都是宏。不需要“&” 在变量y和x之前。
getmaxyx是一个宏
#define getmaxyx(win,y,x) (y = getmaxy(win),x = getmaxx(win))
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。