I'm in.
gg
Added
Need one more judge.
Does this make sense: "Replace 0 characters in s1 at position 3 with '123'"Code:Mid(s1, 3, 0) = "123";
Probably.So, what am I missing here? Some C++ concept that I haven't learned or have forgotten?
here's one possibility with regards to 0 length Mid()'s;
Output:Code:string s1 = "abcdefg"; cout << (Mid(s1,3,0) = "123") << endl;
abc123defg
gg
lmao, y'know, i posted that earlier, and I got side-tracked on one of my new games....lmao....i guess i probably won't even enter sorry bout that
...........thanks for noticing eibro.....lol
Recieved Entries from:
Travis Dane
Codeplug
Sebastiani
Sang-Drax [although he's judging]
Deadline is midnight tommorow.
Contest is over in this timezone! I'll accept any entries I get before I check tommorow.
I've recieved entired from "[email protected]" and "Dorian Boyce", either of you want to enlighten me to your screen name?
What should this code do?
Mid("12345",1,1) = "aaa";
Undefined?
An exception?
Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling
I guess the best option would be if it didn't compile at all:
Code:const std::string s1 = "abc"; Mid(s1,0) = "123"; //SHOULDN'T COMPILE Mid("abc",0) = "123" //SHOULDN'T COMPILE
Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling
Dorian Boyce is me
C Code. C Code Run. Run Code Run... Please!
"Love is like a blackhole, you fall into it... then you get ripped apart"
... and [email protected] is me ...
DavT
What's the status here? We still working on some results??
gg
um yes they should, your forgeting that the assignment works on the returned value or object so, what appears to be an assignment to the function is actually assignement to the functions return.Code:const std::string s1 = "abc"; Mid(s1,0) = "123"; //SHOULDN'T COMPILE Mid("abc",0) = "123" //SHOULDN'T COMPILE
ADVISORY: This users posts are rated CP-MA, for Mature Audiences only.
I agree with you in that it should compile (cuz my version of it does ). The point that Sang-drax is trying to make is that the first argument to Mid() must be modified in the following cases:
So if the first parameter is constant, what do you do? One option is to not let it compile, which in my opinion, limits the functionality unnecessarily.Code:string s1 = "abcdef"; Mid(s1, 2, 2) = "123"; if (s1 != "ab123ef") //checking s1, not return value of Mid() cout << "incorrect!" << endl;
gg
Waiting for golfinguy4's results.Originally posted by Codeplug
What's the status here? We still working on some results??
gg
golfinguy taking his sweet a$$ time....or too busy golfin.
gg