Page 4 of 6 FirstFirst ... 23456 LastLast
Results 31 to 40 of 54
  1. #31

    Na impress kus macro expansion definition of constant raman gud akong gamiton for macros as naandan sa skwelahan. Haha
    Nindut jud ning procedural kay makat-on jud ta's entirety sa mga processes.

    btw, e explain daw ni nga lines:
    #define STRINGIFY(A) #A
    #define STR(A) STRINGIFY(A)


    then naa lage #A ug gigamit lage siya as parameter?

    P.S. Sorry, I'm new to macros and still learning T.T

  2. #32
    Quote Originally Posted by Moonfall View Post
    Na impress kus macro expansion definition of constant raman gud akong gamiton for macros as naandan sa skwelahan. Haha
    Nindut jud ning procedural kay makat-on jud ta's entirety sa mga processes.

    btw, e explain daw ni nga lines:
    #define STRINGIFY(A) #A
    #define STR(A) STRINGIFY(A)


    then naa lage #A ug gigamit lage siya as parameter?

    P.S. Sorry, I'm new to macros and still learning T.T
    diri ra ko nag research2x Stringification - The C Preprocessor

  3. #33
    C.I.A. Sarevok's Avatar
    Join Date
    Apr 2007
    Gender
    Male
    Posts
    2,802
    Blog Entries
    4
    [Programming Language]
    C#

    [Question]
    Reduce the "smelliness" of this function by refactoring it to reduce the number of lines of code. (1 line of code is possible)

    Code:
    string func(string value1, string value2)
    { 
       string result;
       if(value1 != null) {
          result = value1;
       }
       else {
          result = value2;
       }
       return result;
    }

  4. #34
    Code:
    string func(string value1, string value2)
    {
    return (value1 != null) ? value1 : value2;
    }
    sakto?

  5. #35
    C.I.A. Sarevok's Avatar
    Join Date
    Apr 2007
    Gender
    Male
    Posts
    2,802
    Blog Entries
    4
    Quote Originally Posted by csvarona View Post
    Code:
    string func(string value1, string value2)
    {
    return (value1 != null) ? value1 : value2;
    }
    sakto?
    correct. now ako i-increase ang requirement.

    refactor the code so that you will not use the ":" character

  6. #36
    Code:
    string func(string value1, string value2)
    {
    return value1 ?? value2;
    }
    nice

  7. #37
    C.I.A. Sarevok's Avatar
    Join Date
    Apr 2007
    Gender
    Male
    Posts
    2,802
    Blog Entries
    4
    Quote Originally Posted by csvarona View Post
    Code:
    string func(string value1, string value2)
    {
    return value1 ?? value2;
    }
    nice
    correct!

  8. #38
    [Programming Language]
    Java

    [Question]
    What is the output of the following code? (mas maayo if naay explanation para makabalo pud ang mga wala kabalo).

    Code:
    Integer a = 100;
    Integer b = 100;
    Integer c = 1000;
    Integer d = 1000;
    System.out.println(a==b);
    System.out.println(c==d);

  9. #39
    Quote Originally Posted by csvarona View Post
    Code:
    string func(string value1, string value2)
    {
    return value1 ?? value2;
    }
    nice
    Didn't know this trick. I learned something new today.

  10. #40
    Quote Originally Posted by csvarona View Post
    [Programming Language]
    Java

    [Question]
    What is the output of the following code? (mas maayo if naay explanation para makabalo pud ang mga wala kabalo).

    Code:
    Integer a = 100;
    Integer b = 100;
    Integer c = 1000;
    Integer d = 1000;
    System.out.println(a==b);
    System.out.println(c==d);
    My Java is rusty, but I think Integer is an object rather than a primitive type. The == operator, when used on objects, checks if the operands refer to the same object.

    Code:
    int a = 100;
    int b = 100;
    a == b equals true

    Code:
    Integer a = 100;
    Integer b = 100;
    a == b equals false

  11.    Advertisement

Page 4 of 6 FirstFirst ... 23456 LastLast

Similar Threads

 
  1. what is your favorite programming language?
    By sachem in forum Programming
    Replies: 310
    Last Post: 10-08-2015, 03:11 PM
  2. Python programming questions
    By Louis in forum Programming
    Replies: 8
    Last Post: 09-10-2014, 10:51 AM
  3. Beware of 'tricked out' Hijack program
    By cliff_drew in forum Software & Games (Old)
    Replies: 4
    Last Post: 06-24-2009, 02:38 PM
  4. Boot using USB w/ different programs (question)
    By babolgam in forum Computer Hardware
    Replies: 5
    Last Post: 01-22-2009, 11:17 AM
  5. question on networking programming
    By poymode in forum Programming
    Replies: 6
    Last Post: 12-29-2008, 08:15 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
about us
We are the first Cebu Online Media.

iSTORYA.NET is Cebu's Biggest, Southern Philippines' Most Active, and the Philippines' Strongest Online Community!
follow us
#top