Write a C++ program that prompts the user to enter 5

Pages: 123
To be specific, the challenge is only to prompt the user to enter 5, not to make sure that they did 0-0


EDIT:

agent max, nice Mac you have there o_O
Last edited on
agentmax wrote:
My version of clang is just too old, I guess.


Well yes, one cannot expect to compile against the latest standard if one doesn't have a recent compiler. The current version of clang is 13, so that means you are 3 major versions behind.

I like to always have the latest compilers.

Apparently it is easy to install with brew:

$ brew install llvm

https://stackoverflow.com/questions/70168181/apple-clang-13-c20-module-support-missing

Note that this homebrew clang is a different thing to Xcode clang
zapshe wrote:
agent max, nice Mac you have there o_O

Heh, well, it's been bugging me about a software update...maybe it's finally time to do that.

@TheIdeasMan,
Wow, ok, I thought I'd have to pay to download it from Apple or something. Is it the same as the clang++ I've got now?

It being different from the XCode's clang isn't a problem– I think I've used XCode a grand total of once.
@agent max

I just found the link I posted, I don't have a Mac, maybe you could investigate further?

In the past you mentioned swapping to Linux because of issues with paying for Apple stuff, maybe time to look at that again?
Yeah, I don't even have Clang 13– mine is version 10. I'll look into getting a newer version, although I'm not 100% sure it'll work with my 12-year-old iMac.

I did actually look into Linux, and...ehh, nope. I just don't have the computerifical skills necessary to use Linux. Based on a recent post at (https://www.cplusplus.com/forum/lounge/280885/) I don't know if I even want to use Linux...
Last edited on
Apple Clang 10 is substantially behind even the mainline Clang 10 in terms of language support.
https://en.cppreference.com/w/cpp/compiler_support
Last edited on
Crap.
@agent max

That link 404'd for me. Be aware there is a lot of crap posted, things said there may not be accurate, because people post misleading or downright false info to draw comment.

I did actually look into Linux, and...ehh, nope. I just don't have the computerifical skills necessary to use Linux.


But one doesn't need an outrageous skill level to us Linux: just use the GUI side, so it's the same as using Windows or Mac.

Edit:

If you are worried about using the shell, then start with small simple commands. Everyone has to start somewhere.

And one of the benefits for you is that you can have the latest compilers. For example, if I wanted to, I could build the latest version of clang (14.0) because it has experimental support for reflection.

Edit 2:

With software updates: I do them every few days, or even every day. If one leaves it for a long time the updates will be huge. New kernels come out frequently (monthly?) as well.
Last edited on
Well! That's stupid. It was the "Linux Sucks" topic thread. Perhaps you saw it?

I'm not worried about using the shell, I do use it already for compiling and running C++ programs, and doing file searches (with locate), and basic stuff like that.

Every few days...holy Moses. I don't think I even want to do them every month, let alone every few days!!! I just don't have a lot of space left on my computer hard drive, even after dumping pretty near everything onto a NAS a year and a half ago. Plus, my ancient computer takes half a day just to do a flipping software update.
It was the "Linux Sucks" topic thread. Perhaps you saw it?


Well, yes. That was what I had in mind.

I don't think I even want to do them every month, let alone every few days!!!


Again, the longer one leaves it, the bigger the update. Your monthly updates could be > 1 GB, versus < 50MB daily.

Storage space is a problem that is mainly solved by getting more of it, provided that you have already moved data (video, audio, images etc) to other media like USB sticks.

Linux is known for working on old hardware, so that shouldn't be a problem.

As I said previously, try it on a USB stick first, it won't touch your existing drives at all.

max inadvertently added a ) to the link, making the URL processor go all loopy. The link itself is fine.

Just edit it to excise the errant extra bit.
@agent max

You could install g++ on your mac:

http://www.edparrish.net/common/macgpp.php
The trick to putting links in parentheses (https://www.example.com) is to use an empty markup tag at the end:
(https://www.example.com[b][/b])
I just don't have a lot of space left on my computer hard drive, even after dumping pretty near everything onto a NAS a year and a half ago.

My friend had the same issue with her Mac, she didn't even have enough space for the updates! Her Mac came with a 120ishGB of storage, laughable.

I have 2 terabytes of storage on my laptop.


Plus, my ancient computer takes half a day just to do a flipping software update.

Updates should be quick, especially on SSDs. I wouldn't trust Apple, given how they were caught slowing down their older phones..


EDIT:

I only use Linux for projects that require it. I'd almost rather use a MacOS than most Linux distributions.

Its like when cars started having automatic transmissions. Most people are happy they can just press the gas and not have to change gears all the time - others not so much. And its not enough for them that they have the option to switch gears via paddle shifters or the stick on most automatic transmissions, they want to be forced to do so.
Last edited on
I know with a Winders setup adding a secondary HD is not all that difficult, if there is space within the box for it.

All 3 of my desktop PCs have an SSD boot drive with a second non-SSD HD for data storage, installing games and massive applications such as Visual Studio.

VS still requires some data to be stored on the boot drive.

The secondary HD is also a repository for my daily backups of the boot drive.

Despite that my programming development machine still gobbles up a lot of space on the boot partition. Currently approx. 120GB out of 232GB is used, every Windows/VS update chews up more space. A couple of months ago, before several Win/VS updates, the space required was around 100GB.

M'ok, so 20GB isn't all that bad, right? It still is rather aggravating to see the free space being nibbled away.
Have you checked and cleaned out the 'temp' directory - wherever it is located on your system (where the environment names TMP and TEMP point - which can be different for different users - I use c:\temp). I regularly find hundreds/thousands of files left there that can be deleted. Basically, anything in there that isn't in use can be removed. I always clean them out before creating a system image backup.

I routinely clean up temp files along with the browsers cache at least once a day. Some times multiple times. The savings is generally a couple of hundred MBs that don't stay removed.
I routinely clean up temp files along with the browsers cache at least once a day. Some times multiple times. The savings is generally a couple of hundred MBs that don't stay removed

Its funny, I opened VS code for something I was doing and it opened a file that no longer existed. It was the 500MB file I had created to test code I wrote here:

https://cplusplus.com/forum/general/281285/


I deleted the file, but VS code kept it saved somewhere in its temps and just casually opened up the 500MB file.

Sometimes you have to manually go into appdata and check if there are things in there that should be cleaned up that haven't been by whatever cleanup software you normally use.


A few years ago I found that even when deleting all history, cache, and running CCleaner to clean up everything, there was still a file in the temps that contained my browser history on Chrome LOL.
George P wrote:
max inadvertently added a ) to the link, making the URL processor go all loopy. The link itself is fine.

Solved! Whew!

Duthomhas wrote:
The trick to putting links in parentheses (https://www.example.com) is to use an empty markup tag at the end:
(https://www.example.com)

That's weird...but it worked!

Wow. I did not even think about temporary files– I doubt I've cleaned any off my computer since I got it. Sheez...I've probably got at least a hundred GB worth of crapola in there I need to just chuck into the Phantom Zone. Well, I'll see what I can find.

Hm. All I can find in my /tmp directory is some Adobe boiler-plate, about 5 other random logfiles, and a bunch of weird "com.apple.launchd" stuff that I have no clue what that does. Just 2.1 MB of data. Nah, that can't be it.

Well, I don't know where else I'd find useless temporary files. Safari probably has about 5 million cookies stored somewhere; if I could find them, that'd probably free up a few GB's. I always quit applications that I'm not using so I don't use up a ton of processor power, and I think that deletes some stuff.
Last edited on
I routinely use a disk cleaner app, on demand and automated daily cleans, and in the time since I started using it -- about 3 years -- it reports it's cleaned approx. 255GB on each of my 3 desktop PCs. That is 255GB for each PC.

Temp files, junk files from installing and using apps, and browser caches.

My main development PC over 300GB of space saved for the same time period.
Last edited on
Pages: 123