Hello,
I have a struct defined thus:
typedef struct myStruct
{
int j;
} myStruct;
I saw somewhere calls with the following syntax:
f1(&*a)
What should be the protype of f1 so that it will be correct and
so that compilation will succeed ?
I am talking about two cases:
In the first, we have the following definition:
myStruct a;
in the second, we have
myStruct* a;
Is it possible with both case to have a definition of f1() so that
f1(&*a) will be correct and pass compilation ?
Any ideas?
Ian 6 1198
On Oct 17, 10:13 am, "ian...@gmail.com" <ian...@gmail.comwrote:
Hello,
I have a struct defined thus:
typedef struct myStruct
{
int j;
} myStruct;
I saw somewhere calls with the following syntax:
f1(&*a)
What should be the protype of f1 so that it will be correct and
so that compilation will succeed ?
I am talking about two cases:
In the first, we have the following definition:
myStruct a;
in the second, we have
myStruct* a;
Is it possible with both case to have a definition of f1() so that
f1(&*a) will be correct and pass compilation ?
Any ideas?
Ian
void WinWriteMyProgramForMe(void);
On Oct 17, 10:13 am, "ian...@gmail.com" <ian...@gmail.comwrote:
Hello,
I have a struct defined thus:
typedef struct myStruct
{
int j;
} myStruct;
I saw somewhere calls with the following syntax:
f1(&*a)
What should be the protype of f1 so that it will be correct and
so that compilation will succeed ?
I am talking about two cases:
In the first, we have the following definition:
myStruct a;
in the second, we have
myStruct* a;
Is it possible with both case to have a definition of f1() so that
f1(&*a) will be correct and pass compilation ?
Any ideas?
Ian
void WinWriteMyProgramForMe(void);
On Oct 17, 6:40 pm, Richard <rgr...@gmail.comwrote:
Even if it IS homework, I can think of no better place than to ask
here. It is, after all, a C group dedicated to helping people. Or so I
thought.
You are correct, i apologise.
What should be the protype of f1 so that it will be correct and
so that compilation will succeed ?
If you're worried only for the compilation, just cast it.
Anyway, here is some code that does what you ask for.
type f1(myStruct *);
/* ... */
int main(void) {
myStruct obj = { 0 };
myStruct *ptr = &obj;
f1(&obj);
f1(ptr);
f1(&*ptr);
f1(*&ptr);
f1(&ptr[0]);
f1(&0[ptr]);
}
On Wed, 17 Oct 2007 14:13:05 -0000, "ia****@gmail.com"
<ia****@gmail.comwrote:
>Hello,
You posted the same question two hours ago under a different subject
(one letter different). This is not a chat room, you need to give
your message time to propagate and others time to respond. Now go
look at the responses to your original.
Remove del for email This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Elf M. Sternberg |
last post by:
One of the complaints about prototype.js (google for it if you're not
familiar with it) is that it's poorly documented. I have this inkling
that the key to understanding prototype.js is in the...
|
by: Rob Somers |
last post by:
Hey people,
I read a good thread on here regarding the reason why we use function
prototypes, and it answered most of my questions, but I wanted to
double check on a couple of things, as I am...
|
by: pamelafluente |
last post by:
Hi,
I was "studying" the famous (public code) BusyBox. I see the
instruction:
var busyBox = new BusyBox
as in
var busyBox = new BusyBox("BusyBox1", "busyBox", 4, "gears_ani_",
".gif",...
|
by: Daz |
last post by:
Hi everyone.
My query is very straight forward (I think).
What's the difference between
someFunc.blah = function(){ ; }
and
|
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,...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |