Hey,
I was just wondering if i could write my C++ code on notepad and run it etc?
I am asking this because atm i'm at a community centre and on a computer, but not allowed to download anything, so can i?
reply asap please
Hey,
I was just wondering if i could write my C++ code on notepad and run it etc?
I am asking this because atm i'm at a community centre and on a computer, but not allowed to download anything, so can i?
reply asap please
Short answer for : you can absolutely write C++ in Notepad, but Notepad itself won’t produce an executable — you need a compiler. and were right about that; ’s USB idea and ’s suggestion to use a lab machine are the practical alternatives when you can’t install software. Below are short, concrete steps you can apply right away.
Make sure the file really ends with .cpp. Notepad will add “.txt” unless you pick “Save as type: All Files” or put the filename in quotes (for example "main.cpp") when saving — otherwise the compiler won’t recognise the file. (stackoverflow.com)
If a compiler is available (GCC/g++ is common), compile from a command prompt. Example commands:
g++ -std=c++17 -O2 -Wall main.cpp -o main
./main # Linux/mac
main.exe # Windows (CMD) The g++ driver is the standard way to build C++ programs with GCC. (man7.org)
If you cannot install anything on the machine, a portable toolchain on a USB stick is a good workaround (unzip a standalone GCC build and run the g++ binary from the USB), but some centers block running executables from removable media, so check policy first — this is exactly the use case suggested. Stand‑alone Windows GCC builds (no installer) are available. (winlibs.com)
The zero‑install alternative is an online compiler/IDE: paste your source into a site such as OnlineGDB or Replit and click Run — they compile and execute in the cloud (note the usual time/resource limits). If you plan to code regularly at that location, ask staff if they can install a compiler or permit a portable toolchain. (onlinegdb.com)
Jump to Post— Ancient Dragon 5,243you can write your program with notepad but you can't compile it because notepad is not a compiler. If your school computers don't have a compiler then ask one of the teachers if they will download it for you.
Jump to Post— mitrmkar 1,056Sure you can write your C++ code using notepad, it's a text editor after all.
But you need to have a compiler/linker to turn the code into a program which you can then run.
you can write your program with notepad but you can't compile it because notepad is not a compiler. If your school computers don't have a compiler then ask one of the teachers if they will download it for you.
Sure you can write your C++ code using notepad, it's a text editor after all.
But you need to have a compiler/linker to turn the code into a program which you can then run.
Ok, thank you, we're not allowed to download anything lol so ahh well thanks anyways
Ok, thank you, we're not allowed to download anything lol so ahh well thanks anyways
Is it at a school? cause at my school we arent supposed to download anything but we do anyways
Is it at a school? cause at my school we arent supposed to download anything but we do anyways
Even though the thread had been solved it's at a community centre and you can't download things, and at school you can't download anything at all, you only have a couple of programs and controlled internet
ya srry >< after i posted i saw it was solved >< but like its the same thing at my school but we find ways to download stuff
Next time, you could also bring some command-line compiler on USB key, provided you are allowed to transfer data using USB key (Most places do allow this, even though they don`t allow you to install anything). You wouldn`t have to download or install anything, just run the compiler from USB key ;-)
Why don't you ask your school's principal or some other teacher what you want to do and why. Does your school have any computer programming classes ? Yes, then maybe you can use one of their computers to do your work.
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.