Dialog_Schedule::Dialog_Schedule(QWidget *parent ,MainWindow* a) : QDialog(parent),ui(new Ui::Dialog_Schedule) { parent = a; ui->setupUi(this); QRegExp reg(".{1,50}"); ui->okbutton->setEnabled(false); ui->lineEdit->setValidator(new QRegExpValidator(reg,this)); connect(ui->lineEdit,SIGNAL(textChanged(QString)),this,SLOT(okEnabled())); connect(ui->okbutton,SIGNAL(clicked()),this,SLOT(createSchedule())); }
int main() { int k; printf("Please input k: "); scanf("%d", &k); int** schedule = createSchedule(k); for (int i = 1; i < pow(2, k); i++) { std::cout << "\t" << i; } std::cout << std::endl; for (int i = 0; i < pow(2,k); i++) { std::cout << i+1 << "\t"; for (int j = 0; j < pow(2,k)-1; j++) { std::cout << schedule[i][j] << "\t"; } std::cout << std::endl; } for (int i = 0; i < 64; i++){ free(schedule[i]); } free(schedule); // found that last leak. Also, apparently there's a bug in OSX's implementation of valgrind. "2,064 bytes in 1 blocks are possibly lost in loss record 58 of 66" - they lie! return 0; }