Combining two cpp files into one cpp file

wetmoney

I am working on an assignment where I have main.cpp,lego.cpp, and lego.h. My program currently runs fine and gives out the desired output. My issue is that to submit, I must have everything in a single cpp file. Would appreciate if someone could give a simple example. (I want everything in main.cpp)

Merge C++ files into a single source file

i found this link that is similar but I cant grasp the example

wetmoney

if anyone has this problem I just fixed it by doing this

class lego {things in class};

lego::functionA(){}

lego::functionB(){}

int main(){};

make sure that you delete any other cpp files that are in your source folder and remove any header files from main. Was what was causing my issue.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Copying words from one file to another in cpp

CMake file for .cpp+.cu files

Use function defined in one cpp file in function defined in another cpp file in Rcpp

git combining two files into one with history preserved

Two objects with the same name in the same namespace in different cpp files

Combining Multiple files to create one file

git diff for *.cpp files prints nothing in one repository

Why doesn't including 1 header file into two CPP files cause a redefinition error?

cpp files are not generated for capnp_generate_cpp()

What is the purpose of using multiple .cpp files in one solution?

Combining multiple csv files into one csv file

Are .cpp files useful?

One header for multiple cpp-files

combining the text files in to one text file

.cpp to .o files in Makefile

Use of Undeclared Identifier when Using two cpp files

Compile header file and two .cpp files in Unix/Linux (Ubuntu)

cannot compile cpp files under the python pyc script file

combining two files to a single file

Debug some cpp files in one project (VS2015)

Use one globe variable in all cpp files.If one class of the cpp file changed the value,I want to access it from another class cpp file

Using two .cpp files and one header file

How to use scons to build cpp files: each file with an executable?

Message queue for two cpp file with windows API

Mac Link .h file to .cpp files

What happens if member functions of a class in a header file are implemented in two cpp files?

Why would one want to compile multiple .cpp files to the same executable?

Combining two text files into new one text file and giving new condition in python

what differences between two bellow scatter files for CPP compiler and linker?