1. This forum is ARCHIVED! Visit the new Cloud Sixteen forums, codename Eden, at https://eden.cloudsixteen.com. These forums will remain archived for a few months before being closed down, so try to encourage plugin developers to begin moving their content across to the new forums.
Dismiss Notice
Hi Guest, you need a Steam account to register and post on these forums. Login with Steam at the top of the forums to get started!
Dismiss Notice
Hi Guest, do you want to buy HL2RP or another Clockwork schema? Visit the Cloud Sixteen Store to get started!

Other What does 9"*"9 in coding mean

Discussion in 'Development' started by karl-police, Aug 10, 2016.

  1. karl-police

    karl-police Hotrod turret Clockwork Customer

    What does the character "*" mean in coding?

    Like when I use it like this 9*9.

    @NightAngel
     
    • Good Coder Good Coder x 1
  2. duck

    duck Phant0m Legend

    It multiplies the numbers.
     
    • Agree Agree x 3
    • Friendly Friendly x 1
  3. Mr. Meow

    Mr. Meow will code for food Clockwork Customer

    In C++ it also doubles as "dereference operator", in case you want to have a pointer to some variable or object. Pointers allow function to modify the variable passed, instead of being limited to doing stuff with a copy of the original variable (thus not touching the real thing). Here's an example:
    Code:
    void someFunc(int* x) {
        *x += 10; // modify the variable in the address passed to the function
    }
    
    int main() {
        int x = 10;
        std::cout << x << std::endl; // will print '10'
        someFunc(&x); // pass the address of variable 'x' to the function
        std::cout << x << std::endl; // will print '20'
        return 0;
    }
    



    but you know... if you're doing Lua the only thing this operator does is multiply the numbers. Here's a practical example:
    Code:
    local halfWidth = ScrW() * 0.5 -- multiplies your screen's width by 0.5, basically dividing it by 2. Could also be written as ScrW() / 2
    
     
    • Agree Agree x 2
    • Good Coder Good Coder x 1
  4. wtf nerds
     
  5. karl-police

    karl-police Hotrod turret Clockwork Customer

    It ....Eat your fucking fast food FATTY.

    so 9*9 = 81?
     
    • Agree Agree x 1
    • Good Coder Good Coder x 1
  6. Mr. Meow

    Mr. Meow will code for food Clockwork Customer

    Yes.
     
    • Agree Agree x 1
    • Good Coder Good Coder x 1
  7. karl-police

    karl-police Hotrod turret Clockwork Customer

    and how I calculate

    .9*SCREENxSCREEN or a canvas?
     

Previous Readers (Total: 0)