Results 1 to 7 of 7

Thread: C to C#

  1. #1

    Thread Starter
    Lively Member neodatatype's Avatar
    Join Date
    Aug 2002
    Location
    Italy
    Posts
    103

    C to C#

    Someone could tell me how to convert the #declare statement in C#?

    And how can I define an alias for data types?

    And this what does it mean? What's the :1 and :2?

    struct MyStruct
    {
    uint member_a : 1;
    uint member_b : 2;
    }

    Thank you!
    > NeoDataType.net <

    Try my Free .Net Reporting Tool!

  2. #2
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    ´things in C# doesnt work much the way they work in c...here there are not DECLARE's but using's;

  3. #3

    Thread Starter
    Lively Member neodatatype's Avatar
    Join Date
    Aug 2002
    Location
    Italy
    Posts
    103
    ´things in C# doesnt work much the way they work in c...here there are not DECLARE's but using's;
    You're right!
    I would mean #define, not #declare

    Some suggestions now?

    Thanks
    > NeoDataType.net <

    Try my Free .Net Reporting Tool!

  4. #4
    Frenzied Member DevGrp's Avatar
    Join Date
    Nov 2001
    Location
    Charlotte, NC
    Posts
    1,256
    #define = const in C# more or less

    Code:
    //C
    #define PI 3.14
    
    //C#
    const PI = 3.14
    
    //defining alias for data types
    using BigInt = System.Int64;
    
    //using BigInt
    BigInt myInt = 452652;
    Hope that helped.
    Dont gain the world and lose your soul

  5. #5

    Thread Starter
    Lively Member neodatatype's Avatar
    Join Date
    Aug 2002
    Location
    Italy
    Posts
    103
    Code:
    //defining alias for data types
    using BigInt = System.Int64;
    
    //using BigInt
    BigInt myInt = 452652;
    This is good.


    Code:
    //C
    #define PI 3.14
    
    //C#
    const PI = 3.14
    This doesn't do for me

    think this:

    Code:
    #define dec_i public int 
    dec_i myfunc(){...}
    Hope that helped.
    Yes, something good, thanx

    P.S.: some ideas about the struct problem int the initial post?
    > NeoDataType.net <

    Try my Free .Net Reporting Tool!

  6. #6
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    string const String = "hi";

  7. #7

    Thread Starter
    Lively Member neodatatype's Avatar
    Join Date
    Aug 2002
    Location
    Italy
    Posts
    103

    Question

    string const String = "hi";

    why this should help me?

    cya
    > NeoDataType.net <

    Try my Free .Net Reporting Tool!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width