int main() { double pd = sqrt(9); printf("sqrt(9) = %lf\n", pd); hej(); return 0; }
int main (int argc, char **argv) { struct b f_inst = { 1 }; float f = 1.12f; double d = 2.42; printf("f = %f, d = %d\n", f, f_inst.a); hej(); return 0; }
/* plik glowny.c */ int main() { hej(); return 0; }
ChessWindow::ChessWindow() { QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8")); shitAction = new QAction(tr("Shit!"), this); quitAction = new QAction(tr("Avsluta"), this); connect(shitAction, SIGNAL(triggered()), this, SLOT(shit())); connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit())); fileMenu = menuBar()->addMenu("File"); fileMenu->addAction(shitAction); fileMenu->addSeparator(); fileMenu->addAction(quitAction); mainPanel = new QWidget; QVBoxLayout* layout = new QVBoxLayout; mainPanel->setLayout(layout); comp = new ChessComponent; //textEdit = new QTextEdit; button = new QPushButton("KLICKA HÄR!"); //layout->addWidget(textEdit); layout->addWidget(comp); layout->addWidget(button); QObject::connect(button, SIGNAL(clicked()), this, SLOT(hej())); setCentralWidget(mainPanel); setWindowTitle("WELL HELLO THERE"); layout->setSizeConstraint(QLayout::SetFixedSize); }