473,385 Members | 1,356 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Can structures be passed to the functions by value?

Can structures be passed to the functions by value?

Nov 15 '05 #1
7 6215

<sr****************@gmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
Can structures be passed to the functions by value?


Yup
Nov 15 '05 #2
sr****************@gmail.com a écrit :
Can structures be passed to the functions by value?

Yes, but it's just another waste of time an memory...
Nov 15 '05 #3
sr****************@gmail.com a écrit :
Can structures be passed to the functions by value?

Yes, but it's just another waste of time and memory...
Nov 15 '05 #4
Emmanuel Delahaye wrote:
sr****************@gmail.com a écrit :
Can structures be passed to the functions by value?

Yes, but it's just another waste of time and memory...


Uh, that would depend on what you need to do with it.
Nov 15 '05 #5
sr****************@gmail.com writes:
Can structures be passed to the functions by value?


Yes. However, a constant pointer to a structure often saves
memory and may save time.
--
"When I have to rely on inadequacy, I prefer it to be my own."
--Richard Heathfield
Nov 15 '05 #6
In article <87************@benpfaff.org>,
Ben Pfaff <bl*@cs.stanford.edu> wrote:
Can structures be passed to the functions by value?
Yes. However, a constant pointer to a structure often saves
memory and may save time.


The reverse may also be true. Small structures are often passed in
registers.

-- Richard
Nov 15 '05 #7
ri*****@cogsci.ed.ac.uk (Richard Tobin) writes:
In article <87************@benpfaff.org>,
Ben Pfaff <bl*@cs.stanford.edu> wrote:
Can structures be passed to the functions by value?

Yes. However, a constant pointer to a structure often saves
memory and may save time.


The reverse may also be true. Small structures are often passed in
registers.


Yes, this is true. I should have qualified my statement with
"sufficiently large". Of course, nothing is guaranteed in any
case.
--
Here's a tip: null pointers don't have to be *dull* pointers!
Nov 15 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Ivan | last post by:
Hi All, I have a problem with marshaling complex structures (containing numbers, strings, arrays of another structures) to native C function in dll. I have already posted same question to...
11
by: Bradford Chamberlain | last post by:
I work a lot with multidimensional arrays of dynamic size in C, implementing them using a single-dimensional C array and the appropriate multipliers and offsets to index into it appropriately. I...
4
by: Thomas Paul Diffenbach | last post by:
Can anyone point me to an open source library of /statically allocated/ data structures? I'm writing some code that would benefit from trees, preferably self balancing, but on an embedded system...
20
by: Michael | last post by:
Hi there, I've got a simple (newbee)-question. Is the following thing right? struct x { int a; int b; } ...
14
by: pmclinn | last post by:
I've noticed that many programmers use classes to store data about such things like: Class Customers .....Phone ....ID ....Address End Class....
8
by: skumar434 | last post by:
i need to store the data from a data base in to structure .............the problem is like this ....suppose there is a data base which stores the sequence no and item type etc ...but i need only...
44
by: svata | last post by:
Hello, I wonder how to resize such array of structures using realloc()? #include <stdio.h> #include <stdlib.h> #define FIRST 7 typedef struct { char *name;
4
by: sofeng | last post by:
The following link shows a chart I created about passing structures among functions. Would you review it and tell me if it requires any corrections? ...
8
by: Sheldon | last post by:
Hi, Can anyone help with this problem with setting up nested structures and initializing them for use. I have created several structs and placed them in a super struct that I will then pass to...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.