Results 1 to 5 of 5
  1. #1
    Bethgizin's Avatar
    Join Date
    Mar 2012
    Gender
    male
    Location
    Montreal, Quebec. Canada
    Posts
    82
    Reputation
    8
    Thanks
    17

    What would this do if I used it in a console?

    Code:
    #include <iostream>
    using namespace std;
    
    template <class T>
    T GetMax (T a, T b) {
      T result;
      result = (a>b)? a : b;
      return (result);
    }
    
    int main () {
      int i=5, j=6, k;
      long l=10, m=5, n;
      k=GetMax<int>(i,j);
      n=GetMax<long>(l,m);
      cout << k << endl;
      cout << n << endl;
      return 0;
    }
    What would this do if I used it in my upcoming console?

  2. #2
    tenkan's Avatar
    Join Date
    Apr 2011
    Gender
    male
    Posts
    836
    Reputation
    10
    Thanks
    45
    My Mood
    Amused
    You got code and you don't know what it does...?

  3. #3
    Bethgizin's Avatar
    Join Date
    Mar 2012
    Gender
    male
    Location
    Montreal, Quebec. Canada
    Posts
    82
    Reputation
    8
    Thanks
    17
    Quote Originally Posted by tenkan View Post
    You got code and you don't know what it does...?

    I just learned how to code and I am making a console. I just don't know the templates and class definitions that good yet.

  4. #4
    DanK's Avatar
    Join Date
    Aug 2006
    Gender
    male
    Location
    Arizona
    Posts
    2,892
    Reputation
    100
    Thanks
    3,632
    My Mood
    Devilish
    Quote Originally Posted by Bethgizin View Post
    Code:
    #include <iostream>
    using namespace std;
    
    template <class T>
    T GetMax (T a, T b) {
      T result;
      result = (a>b)? a : b;
      return (result);
    }
    
    int main () {
      int i=5, j=6, k;
      long l=10, m=5, n;
      k=GetMax<int>(i,j);
      n=GetMax<long>(l,m);
      cout << k << endl;
      cout << n << endl;
      return 0;
    }
    What would this do if I used it in my upcoming console?
    It would print 2 lines in the console.
    line 1: 6
    line 2: 10.

    You are just finding random code on the internet which has nothing to do with consoles and just throwing it in there??

    o.O
    PLAYING RIFT!

  5. #5
    Nico's Avatar
    Join Date
    Jan 2011
    Gender
    male
    Location
    Germany :D
    Posts
    15,918
    Reputation
    1121
    Thanks
    8,617
    That's going to be a nice console.

Similar Threads

  1. What would you think of a pc like this?
    By 100% in forum General
    Replies: 40
    Last Post: 07-09-2011, 06:19 AM
  2. What would you give for this ?
    By mrkiller2011 in forum CrossFire Discussions
    Replies: 12
    Last Post: 03-02-2011, 04:12 PM
  3. What would cause this?
    By Dead 4 Real in forum Combat Arms Coding Help & Discussion
    Replies: 5
    Last Post: 01-21-2011, 08:09 PM
  4. What would you use...
    By gbitz in forum General
    Replies: 62
    Last Post: 11-19-2009, 01:12 AM