我在Laravel有一个项目,我在公共目录中有论坛,我不想将它推送到存储库,所以我写了.gitignore:
### Laravel ###
vendor/
node_modules/
# Laravel 5 & Lumen specific
bootstrap/cache/
.env.*.php
.env.php
.env
# SMF
public/forum/
# Rocketeer PHP task runner and deployment package. https://github.com/rocketeers/rocketeer
.rocketeer/
Run Code Online (Sandbox Code Playgroud)
但是,该条目仍然出现在Git状态
这里是我的树:
+ ...
+ public
++ forum
+++ ...
+ ...
问题出在哪里?
我想将我的代码分成多个文件。此时我有这样的想法,但每次我需要将库和标头包含到每个文件中。
这是更好的方法吗?
主程序
#include <iostream>
#include <stdio.h>
#include <cstdlib>
#include <conio.h>
#include <string.h>
#include <windows.h>
#include "modules/intro.cpp"
#include "modules/login.cpp"
using namespace std;
int main() {
introModule();
login();
system("pause");
}
Run Code Online (Sandbox Code Playgroud)
简介.cpp
#include <iostream>
using namespace std;
void introModule() {
// content of intro file
}
Run Code Online (Sandbox Code Playgroud)
登录.cpp
#include <iostream>
#include <conio.h>
#include <string.h>
#include <windows.h>
#include "menu.cpp"
using namespace std;
#define ENTER 13
#define BACKSPACE 8
char passInputCharacter;
char password[20];
const char *accessPassword = "123";
int passInputCharacterPosition = 0;
HANDLE hConsole = …Run Code Online (Sandbox Code Playgroud) 如果这些记录在另一个表中不存在,我需要从表中获取所有记录,例如
表“汽车”
| ID | Name_of_car
+----+----------------
| 1 .| Toyota
+----+----------------
| 2 .| Ford
Run Code Online (Sandbox Code Playgroud)
表 'Crashed_cars'
| car_id | crash_date
+--------+----------------
| 1 .....| 22-02-2016
Run Code Online (Sandbox Code Playgroud)
现在我想得到所有没有撞毁的汽车 - 我该怎么做?
目前我使用循环,但由于条目数量(大约 3000),我将不得不使用直接收集。这是我的查询:
Cars::select( 'id', 'firstname', 'lastname', 'car', 'color' )->get();
Run Code Online (Sandbox Code Playgroud) 我正在使用https://github.com/nlohmann/json
中的库
,我需要将 JSON 写入文件,但我在文档中找不到任何关于此的想法。
有人可以帮忙吗?