How do i cut off this long string? with cout

i tired using precision and setting it to 30 but that doesnt work
17 Replies
The Many
The Many3y ago
when you use strcpy give it 30 as a third parameter check utils.cpp you'll see it takes a length param
Revan
Revan3y ago
if i do that then this becomes shortened though
Revan
Revan3y ago
unless i make a temp variable that store the short version and then strcpy
mu5h1e
mu5h1e3y ago
Which is what you do
Revan
Revan3y ago
tyty, the last minute submission time is getting to me lol
The Many
The Many3y ago
i got a memory leak i couldn't fix so i asked for an extension lol
mu5h1e
mu5h1e3y ago
Not fun ;-;
The Many
The Many3y ago
yeah i've been neglecting my other classes just to focus on these workshops and i still can't make the notlikethis
mu5h1e
mu5h1e3y ago
Wait in this assignment?
The Many
The Many3y ago
yea
mu5h1e
mu5h1e3y ago
Or the last one
The Many
The Many3y ago
last one was tough as nails too lol
mu5h1e
mu5h1e3y ago
Where do you dynamically allocate memory here?
The Many
The Many3y ago
for the name
mu5h1e
mu5h1e3y ago
Hmm
The Many
The Many3y ago
these bits
mu5h1e
mu5h1e3y ago
Lemme see code
Want results from more Discord servers?
Add your server