how to make our own library for c and cpp ? | Sololearn: Learn to code for FREE!

+1

how to make our own library for c and cpp ?

( can i done this with my mobile ? )

4/9/2021 6:48:40 AM

#...._._...._<........>

7 Answers

New Answer

+2

I dont know (sorry cuz i do my stuffs on emulated softwares :b), but termux does allow this, and i tested it. You can DM me for further assistance regarding termux, or visit its wiki page.

+2

BeegCat , i know this termux app but I haven't used that app yet. and i see my friend use this app. can you tell me link proper link of termux app ? because on the Play Store so many apps are there that's name is termux.

+2

Termux (Terminal emulator with packages) - https://f-droid.org/packages/com.termux This is the fdroid link, cuz playstore no longer will support future updates for termux due to changes in android policy

+1

BeegCat , very nice answer, but still i have some doubts. ( you know any mobile app\compiler that support header file creation ? )

0

Header files basically contain function body and macro definitions. Basically make a file and store macro definitions like #define/ #if/ #pragma etc. If its a simple function, just add the definition of ur function and save this file as `somename.h`. You need not add the main function/ any other header file Coming to ur main code: Create a new file and save it as someothername.c and *include ur header file somename.h*. But dont add angular braces(<>), instead use double quotes (" ")and type in ur code and call the function. Save the code. Now comes the main part: for this to work, the header file you had made and the someothername.c file should be in the same folder. This should work. At least on pc. For phone, you need a compiler app which can support header file creation and similar stuffs.