python (65.1k questions)
javascript (44.2k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (12.9k questions)
How can you change the value of a string pointer that is passed to a function in C++?
I need to change the value of a std::string using a function.
The function must be void, and the parameter must be a pointer to a string as shown.
#include <iostream>
void changeToBanana(std::s...
jye
Votes: 0
Answers: 2
Does std::string needs explicit resizing or does it handles resizing itself?
I am trying to write a std::string in a file and then reading it back.
Why do i need to resize the string while reading back the text (see the commented line below while reading back the string)? Does...
Helena
Votes: 0
Answers: 2
Reading from file without using string
I am doing a school project where we must not use std::string. How can I do this? In the txt file the data are separated with a ";", and we do not know the length of the words.
Example:
appl...
petizana
Votes: 0
Answers: 1
C++ std::string attribute of a class comes up as an empty string after initialized
So i have a pretty straight foward homework that consist in creating a student class that has a name and 3 grades as attributes and a method to caluculate the final grade and append the name as well a...
Tomás
Votes: 0
Answers: 2