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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How declare a Function with 8 Inputs and 4 Outputs ??

How declare a Function with 8 Inputs and 4 Outputs ??

Scheduled Pinned Locked Moved C / C++ / MFC
question
3 Posts 3 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.
  • Y Offline
    Y Offline
    youssef
    wrote on last edited by
    #1

    Hi, I would like to create a function with 8 Inputs and the result is in 4 Ouputs. How can I declare it? Best Regards youssef

    L 1 Reply Last reply
    0
    • Y youssef

      Hi, I would like to create a function with 8 Inputs and the result is in 4 Ouputs. How can I declare it? Best Regards youssef

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Hi Are you really shure that you want to have that many in and outputs in one function? Maybe the function is doing too much and you should consider splitting it up in several functions. Else, while a function only can return one value you have to get the result through the parameters in the function using pointers or references. Something like: myFunction(in1,in2,in3,in4,in5,in6,in7,in8,*out1,*out2,*out3,*out4). /Per

      F 1 Reply Last reply
      0
      • L Lost User

        Hi Are you really shure that you want to have that many in and outputs in one function? Maybe the function is doing too much and you should consider splitting it up in several functions. Else, while a function only can return one value you have to get the result through the parameters in the function using pointers or references. Something like: myFunction(in1,in2,in3,in4,in5,in6,in7,in8,*out1,*out2,*out3,*out4). /Per

        F Offline
        F Offline
        fantastic_mr_fox
        wrote on last edited by
        #3

        the other asy is to group your values into structures or clases (input and output) then it's easy... COutputInfo DoSomeCalcs( CInputInfo in ) { : }:) =)

        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