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))