This certainly fits with the modern definition of “hacked”; that something has changed, and the person experiencing the change does not understand what happened.
While iPhone hacks do exist, they’re exceedingly rare, targeted, and expensive, based on available information.
In this case, the bar patron likely demonstrated a feature of iPhone known as NameDrop.
NameDrop is not a security problem, nor a hack:
Use NameDrop on iPhone to share your contact info - Apple Support
You can control NameDrop:
Secure NameDrop - Apple Support
Given your reference to Fitness, here is how to add a friend in Fitness:
Share your activity in Fitness on iPhone - Apple Support
Oh, and I’d keep my phone in my pocket in crowds. Not because of hacks, or NameDrop, just for crowd awareness, and for reducing thefts.
The CC was not a C compilation command, as iPhone has no C compiler installed and nobody is going to install a C compiler as part of exploiting a security vulnerability. More likely, the CC you saw likely the initials of the person you were chatting with. Apple uses initials as an avatar in various placed. (This initials avatar is guess, as the info or image has not been posted, and I don’t know if Claudiade’s initials are alliterative. Probably wasn’t Claudia de' Medici, though Claudia de C-something is certainly possible.)
To assuage some of your concerns here and to check your location sharing settings, run Safety Check:
Personal Safety User Guide - Apple Support