Last active
June 29, 2018 14:28
-
-
Save sixpetrov/026b84925212afdbb7cc0af8adafd5aa to your computer and use it in GitHub Desktop.
#cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Block comment | |
*/ | |
#include <vector> | |
using namespace std; // line comment | |
namespace foo { | |
typedef struct Struct { | |
int field; | |
} Typedef; | |
enum Enum {Foo = 1, Bar = 2}; | |
Typedef *globalVar; | |
extern Typedef *externVar; | |
template<typename T, int N> | |
class Class { | |
T n; | |
public: | |
/** | |
* Semantic highlighting: | |
* Generated spectrum to pick colors for local variables and parameters: | |
* Color#1 SC1.1 SC1.2 SC1.3 SC1.4 Color#2 SC2.1 SC2.2 SC2.3 SC2.4 Color#3 | |
* Color#3 SC3.1 SC3.2 SC3.3 SC3.4 Color#4 SC4.1 SC4.2 SC4.3 SC4.4 Color#5 | |
*/ | |
void function(int param1, int param2, int param3) { | |
int localVar1, localVar2, localVar3; | |
int *localVar = new int[1]; | |
this->n = N; | |
localVar1 = param1 + param2 + localVar3; | |
label: | |
printf("Formatted string %d\n\g", localVar[0]); | |
printf(R"**(Formatted raw-string %d\n)**", 1); | |
std::cout << (1 << 2) << std::endl; | |
#define FOO(A) A | |
#ifdef DEBUG | |
printf("debug"); | |
#endif | |
} | |
}; | |
} | |
MainWindow::MainWindow(QWidget *parent) : | |
QMainWindow(parent), | |
ui(new Ui::MainWindow) | |
{ | |
ui->setupUi(this); | |
ui->tableWidget->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); | |
connect(ui->pushButton, &QPushButton::clicked, | |
this, &MainWindow::button_clicked); | |
} | |
MainWindow::~MainWindow() | |
{ | |
delete ui; | |
} | |
void MainWindow::button_clicked() | |
{ | |
qDebug() << "test"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
why is this not working on codeblocks ??