Skip to main content
Commonmark migration
Source Link

#C++14, 30 bytes

C++14, 30 bytes

As unnamed lambda (allowed in Python):

[](decltype('B')*c){*c='C'-2;} //'c'-2 for lowercase

//Usage:
#include <iostream>
main(){
  char c;
  [](decltype('B')*c){*c='C'-2;}(&c);
  std::cout << c << std::endl;
}

33 bytes

Function that assigns to its parameter:

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

#C++14, 30 bytes

As unnamed lambda (allowed in Python):

[](decltype('B')*c){*c='C'-2;} //'c'-2 for lowercase

//Usage:
#include <iostream>
main(){
  char c;
  [](decltype('B')*c){*c='C'-2;}(&c);
  std::cout << c << std::endl;
}

33 bytes

Function that assigns to its parameter:

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

C++14, 30 bytes

As unnamed lambda (allowed in Python):

[](decltype('B')*c){*c='C'-2;} //'c'-2 for lowercase

//Usage:
#include <iostream>
main(){
  char c;
  [](decltype('B')*c){*c='C'-2;}(&c);
  std::cout << c << std::endl;
}

33 bytes

Function that assigns to its parameter:

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

deleted 18 characters in body
Source Link
Karl Napf
  • 4.4k
  • 13
  • 31

#C++11#C++14, 30 bytes

As unnamed lambda (allowed in Python):

[](decltype('B')*c){*c='C'-2;} //'c'-2 for lowercase

//Usage:
#include <iostream>
main(){
  char c;
  [](decltype('B')*c){*c='C'-2;}(&c);
  std::cout << c << std::endl;
}

33 bytes

Function that assigns to its parameter:

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

#C++11, 30 bytes

As unnamed lambda (allowed in Python):

[](decltype('B')*c){*c='C'-2;} //'c'-2 for lowercase

//Usage:
#include <iostream>
main(){
  char c;
  [](decltype('B')*c){*c='C'-2;}(&c);
  std::cout << c << std::endl;
}

33 bytes

Function that assigns to its parameter:

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

#C++14, 30 bytes

As unnamed lambda (allowed in Python):

[](decltype('B')*c){*c='C'-2;} //'c'-2 for lowercase

//Usage:
#include <iostream>
main(){
  char c;
  [](decltype('B')*c){*c='C'-2;}(&c);
  std::cout << c << std::endl;
}

33 bytes

Function that assigns to its parameter:

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

added 218 characters in body
Source Link
Karl Napf
  • 4.4k
  • 13
  • 31

#C++11, 3330 bytes

Function that assigns to its parameterAs unnamed lambda (allowed in Python):

int[](decltype('B')*c){*c='C'-2;} f//'c'-2 for lowercase

//Usage:
#include <iostream>
main(){
  char c;
  [](decltype('B')*c){*c='C'-2;}(&c);
  std::cout << c << std::endl;
}

33 bytes

Also allows lowercaseFunction that assigns to its parameter:

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

Usage:


//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

#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

#C++11, 30 bytes

As unnamed lambda (allowed in Python):

[](decltype('B')*c){*c='C'-2;} //'c'-2 for lowercase

//Usage:
#include <iostream>
main(){
  char c;
  [](decltype('B')*c){*c='C'-2;}(&c);
  std::cout << c << std::endl;
}

33 bytes

Function that assigns to its parameter:

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

added 8 characters in body
Source Link
Karl Napf
  • 4.4k
  • 13
  • 31
Loading
Source Link
Karl Napf
  • 4.4k
  • 13
  • 31
Loading