Thread: Need Urgent Help

  1. #1
    A cursed Student
    Guest

    Unhappy Need Urgent Help

    I got this assignment which is going to due very very soon so pls help me. Help to this poor Student, I dont want to fail.

    i) A function called smallest that takes 2 integer arguments and returns a reference to the smallest of the two.
    ii)A void function called upperCase that takes as an arguement an array of characters that is converted into their upper case equivelant.

    I know this is a piece of cake for u if u can help me i `ll be very happy

  2. #2
    aurė entuluva! mithrandir's Avatar
    Join Date
    Aug 2001
    Posts
    1,209
    Post your code and I might help you if you have errors.

  3. #3
    A cursed Student
    Guest

    Unhappy

    I`ll be honest ... I dont have the code. I did Java before but C, i have no clue about how to do it

  4. #4
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    heres the first one:-

    int& smallest(const int &x,const int& y)
    {
    return ((x<y)? x:y);
    }

    oops thats c++ this is the c way

    int * smallest(int* x,int* y)
    {
    return ((*x<*y)? x:y);
    }
    Last edited by Stoned_Coder; 09-08-2001 at 06:37 AM.
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

  5. #5
    A cursed Student
    Guest

    Talking Need Urgent Help

    Thanx for helping, That was very nice.


    FREE THE CANNABIS

  6. #6
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    How is it that so many of you are being tested on things you have no idea about? This seems to happen quite frequently!
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

  7. #7
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    You don't want to fail but you also don't want to learn. hmmmm.

  8. #8
    Registered User
    Join Date
    Sep 2001
    Posts
    3

    Angry Excuse Me

    I do wanna Learn. But the reason i dont know how c works is cos i arrived to Uni about 3 weeks late cos i couldnt find a plane ticket. Therefore i missed my practicals and tutes... Is this a good excuse. I read through the text book maybe ten times, i did the stuff on it but it aint help.

  9. #9
    Registered User
    Join Date
    Sep 2001
    Posts
    3
    Here is the second one:

    void upperCase(char *t)
    {
    int i=0;
    while(t[i]!='\0')
    {
    if ( 'a'<=t[i] && t[i]<='z' )
    t[i]=t[i]-'a' + 'A';

    /*incrementation:*/
    i++;
    }
    }

    /*Caution : I did not try it. */
    Last edited by aripata; 09-10-2001 at 10:29 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Urgent Help Needed In Writing Algorithm!!
    By Vikramnb in forum C++ Programming
    Replies: 1
    Last Post: 01-09-2009, 12:46 PM
  2. beginner plzz help urgent
    By sara101 in forum C Programming
    Replies: 11
    Last Post: 01-14-2007, 10:38 PM
  3. pls help me urgent..
    By intruder in forum C Programming
    Replies: 4
    Last Post: 01-13-2003, 04:41 AM
  4. Help Needed: Borland C++ 5.5 Installation - URGENT!
    By Linette in forum C++ Programming
    Replies: 12
    Last Post: 03-09-2002, 06:44 PM
  5. Help.... Urgent... Thanks!
    By weihann in forum C Programming
    Replies: 0
    Last Post: 02-27-2002, 10:15 PM