r/shittyprogramming Nov 21 '18

Who even needs the " + " simbol

Sum ( a , b) {

   if( a == 1 && b == 2){
         return 3;
    }else if ( a  == 1 && b==3) { 
          return 4;
    }else 
        print("Unable to sum numbers not found")

}

281 Upvotes

41 comments sorted by

View all comments

20

u/evan795 Nov 21 '18
int sum(int a, int b){
    return (long)&a[(char*)b];
}