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

Using two .cpp files and one header file

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

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

One header for multiple cpp-files

CMake file for .cpp+.cu files

Mac Link .h file to .cpp files

Message queue for two cpp file with windows API

Copying words from one file to another in cpp

combining two files to a single file

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

What happens if member functions of a class in a header file are implemented in two cpp 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

cpp files are not generated for capnp_generate_cpp()

Are .cpp files useful?

.cpp to .o files in Makefile

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

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

Use of Undeclared Identifier when Using two cpp files

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

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

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

Debug some cpp files in one project (VS2015)

Combining Multiple files to create one file

Combining multiple csv files into one csv file

combining the text files in to one text file

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

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

cannot compile cpp files under the python pyc script file