Thread: Newby needs help

  1. #1
    Registered User
    Join Date
    Jul 2009
    Posts
    1

    Exclamation Newby needs help

    Hello everyone,
    New guy here. I am learning some C Programming and in URGENT need of some help. It seems that there aren't many people that can still write C. Can anyone help with writting the following code?
    Does anyone live in the Richmond, VA area?

    a) Write a C program that has a declaration in main() to store the following numbers into an array named channels: 2, 4, 5, 7, 9, 11, 13. There should be a function call to display() that accepts the channels as an argument named channels and then displays the numbers using the pointer notation *(channels + i).


    b) Modify this display() function to alter the address in channels. Always use the expression *channels rather than *(channels + i) to retrieve the correct elements.

    Thanks for the help!

  2. #2
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    We don't do homework here. Post the code you are working with and we will try to help out with whatever problems you run into.

    Cheers.
    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;
    }

  3. #3
    DESTINY BEN10's Avatar
    Join Date
    Jul 2008
    Location
    in front of my computer
    Posts
    804
    Quote Originally Posted by dusk2dawn View Post
    Hello everyone,
    New guy here. I am learning some C Programming and in URGENT need of some help. It seems that there aren't many people that can still write C. Can anyone help with writting the following code?
    Does anyone live in the Richmond, VA area?

    a) Write a C program that has a declaration in main() to store the following numbers into an array named channels: 2, 4, 5, 7, 9, 11, 13. There should be a function call to display() that accepts the channels as an argument named channels and then displays the numbers using the pointer notation *(channels + i).


    b) Modify this display() function to alter the address in channels. Always use the expression *channels rather than *(channels + i) to retrieve the correct elements.

    Thanks for the help!
    I think they are just beginner problems on array and pointers, so try a hand on it yourself. I'm sure you'll definitely come up with something. If you get stuck somewhere then people on this forum are there to help you.
    HOPE YOU UNDERSTAND.......

    By associating with wise people you will become wise yourself
    It's fine to celebrate success but it is more important to heed the lessons of failure
    We've got to put a lot of money into changing behavior


    PC specifications- 512MB RAM, Windows XP sp3, 2.79 GHz pentium D.
    IDE- Microsoft Visual Studio 2008 Express Edition

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C Newby - help with type double
    By talkingtina in forum C Programming
    Replies: 5
    Last Post: 04-13-2008, 11:23 PM
  2. Newby Question
    By LiteIce in forum C++ Programming
    Replies: 3
    Last Post: 10-22-2007, 06:01 PM
  3. Newby array problem
    By dogbert234 in forum C++ Programming
    Replies: 7
    Last Post: 11-28-2005, 04:48 PM
  4. A newby question on the sizeof operator
    By Evo in forum C++ Programming
    Replies: 2
    Last Post: 07-19-2002, 03:17 AM