Thread: question on type of code

  1. #1
    Registered User
    Join Date
    Jan 2017
    Posts
    9

    question on type of code

    hi, I saw a bit of code and I'd like to know how I could do something similar.
    AD7785.cpp
    Code:
    void AD7785::SPI_Close(void)
    {
    SPI.end();
    }
    within another file I include AD7785.cpp and call it like this:
    Code:
    AD7785.SPI_Close();
    and in AD7785.cpp, i call SPI_Close as if it were just a normal function

    thanks, sorry if this is something really simple, but I don't know where else to look.

  2. #2
    Registered User rstanley's Avatar
    Join Date
    Jun 2014
    Location
    New York, NY
    Posts
    1,110
    Your code is C++. This is a C Programming Language forum.

    This needs to be moved to the C++ forum.

    .cpp is a C++ file extension.

  3. #3
    Registered User
    Join Date
    Jan 2017
    Posts
    9
    Sorry, I kinda went on autopilot. I copied the post to C++

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. What is the return value for a type Class? code example
    By tmac619619 in forum C++ Programming
    Replies: 2
    Last Post: 04-25-2014, 11:57 AM
  2. Simple type question in c (factorial code example)
    By patishi in forum C Programming
    Replies: 8
    Last Post: 08-28-2013, 07:45 PM
  3. Type with code
    By kairozamorro in forum C# Programming
    Replies: 5
    Last Post: 04-30-2010, 06:10 PM
  4. Terminal type? Access code?
    By RedZippo in forum C++ Programming
    Replies: 10
    Last Post: 03-31-2004, 09:37 AM
  5. Code to find the day type of day in the year?
    By Unregistered in forum C Programming
    Replies: 3
    Last Post: 04-01-2002, 08:58 PM

Tags for this Thread