Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Passing arrays to functions(Simple question)!

Passing arrays to functions(Simple question)!

Scheduled Pinned Locked Moved C / C++ / MFC
questiondata-structureshelp
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Paddy
    wrote on last edited by
    #1

    Hi, hope someone can help me out here! Is it possible to pass an array to a function? I have a double data[32768] and I want to process it in some other function but I'm not sure of the syntax used to pass the array to another function. I tried double[] void Window(double data[]) { return data[]; } but obviously that didn't work! Thanks in advance, Paddy

    J 1 Reply Last reply
    0
    • P Paddy

      Hi, hope someone can help me out here! Is it possible to pass an array to a function? I have a double data[32768] and I want to process it in some other function but I'm not sure of the syntax used to pass the array to another function. I tried double[] void Window(double data[]) { return data[]; } but obviously that didn't work! Thanks in advance, Paddy

      J Offline
      J Offline
      Joao Paulo Figueira
      wrote on last edited by
      #2

      Paddy wrote: double[] void Window(double data[]) Did you compiler swallow this? :wtf: You should be doing something like this (if I get your point):

      double *Window(double *data, size_t count)
      {
      return data;
      }

      P 1 Reply Last reply
      0
      • J Joao Paulo Figueira

        Paddy wrote: double[] void Window(double data[]) Did you compiler swallow this? :wtf: You should be doing something like this (if I get your point):

        double *Window(double *data, size_t count)
        {
        return data;
        }

        P Offline
        P Offline
        Paddy
        wrote on last edited by
        #3

        Thanks for the help thats exactly what I was looking for! No my compiler didn't like the double[] void Window(double data[]) attempt, ha ha! paddy

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups