Skip to main content
2 of 5
added 8 characters in body
Karl Napf
  • 4.4k
  • 13
  • 31

#C++11, 33 bytes

Function that assigns to its parameter:

int f(decltype('B')*c){*c='C'-2;}

Also allows lowercase:

int f(decltype('B')*c){*c='c'-2;}

Usage:

#include <iostream>
main(){
 char c;
 f(&c);
 std::cout << c << std::endl;
}

Pretty hard to do it otherwise since no #include, return or auto because of U. Modifying parameters for return values seems ok Meta

Karl Napf
  • 4.4k
  • 13
  • 31