Function

Is somebody able to write a function that changes the information in a board for another string of caracters?
Yes.
I can do that as well, though probably not as efficiently or elegantly as helios is capable of doing.
Regardless, somebody is able to write such a function.
ask a full question -- you have to help us help you.
something like
"I am tring to do this, and I can't because some reason"
here is my attempt at it in c++ ( in code tags) :

optional but helpful:
this is the input
this is the (incorrect) output
this is the desired output
hp14 wrote:
Is somebody able to write a function that changes the information in a board for another string of caracters[sic]?


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <iostream>
#include <string>
using namespace std;

void change( string &str )
{
   str = "another set of characters";
}

int main()
{
   string a_board = "the information";
   cout << a_board << '\n';
   change( a_board );
   cout << a_board << '\n';
}
Last edited on
Topic archived. No new replies allowed.