By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,421 Members | 1,127 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,421 IT Pros & Developers. It's quick & easy.

Structure Pointer

P: n/a
Hi
I am having some warning when i used like this
struct creat_table {
--------
----------
};
struct creat_table *table();
int main()
{
struct creat_table *p;
p =table();
}
struct creat_table *table()
{

}
I used to get Some warning like
Incompatible assignment Please if any body find solution can u
expalin it

Feb 23 '07 #1
Share this Question
Share on Google+
17 Replies


P: n/a
"RAKHE" <t.***************@gmail.comwrites:
I am having some warning when i used like this
struct creat_table {
--------
----------
};
struct creat_table *table();
int main()
{
struct creat_table *p;
p =table();
}
struct creat_table *table()
{

}
I used to get Some warning like
Incompatible assignment Please if any body find solution can u
expalin it
Please don't use silly abbrevations like "u". If you want us to take
the time to read your article, take the time to spell out the words.

After I cleaned up the code you posted (removing the "--------" lines,
adding a dummy member to the structure), it compiled without error.
My conclusion is that the code you posted differs from the code that's
giving you the warning. We're not mindreaders; we can't possibly tell
you what's wrong with your code unless you actually show it to us.

And you say you got a warning "something like" Incompatible
assignment. Don't tell us what the warning is like; tell us what it
really is.

Write a small complete compilable program that illustrates the
problem. Post it exactly (copy-and-paste, don't re-type), and tell us
what the problem is.

If you're going to post to a newsgroup, it's a good idea to read the
group for a while, or at least browse the archives. If you had done
so, this reply would not be necessary, because everything I'm saying
has already been posted here many many times.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Feb 23 '07 #2

P: n/a
On 22 Feb 2007 20:42:19 -0800, "RAKHE" <t.***************@gmail.com>
wrote:
>Hi
I am having some warning when i used like this
struct creat_table {
--------
----------
};
struct creat_table *table();
int main()
{
struct creat_table *p;
p =table();
}
struct creat_table *table()
{

}
I used to get Some warning like
Incompatible assignment Please if any body find solution can u
expalin it
I'm really curious as to why you chose to name your struct
"creat_table" instead of "create_table". We had an incompetent
programmer working for us who chose to use the same naming convention,
and we always wondered why in the world he chose to omit the final 'e'
in "create". I'm not saying you're incompetent--I just want to know
what your rationale is behind choosing "creat" (which we pronounce
"kreet") over "create".

Best regards
--
jay
Feb 23 '07 #3

P: n/a
RAKHE wrote:
Hi
I am having some warning when i used like this
struct creat_table {
--------
----------
};
struct creat_table *table();
int main()
{
struct creat_table *p;
p =table();
}
struct creat_table *table()
{

}
I used to get Some warning like
Incompatible assignment Please if any body find solution can u
expalin it
If you want assistance, please post a minimal, compilable program that
exhibits your problem. Use cut and paste, don't retype. If relevant,
post the actual text of the compiler's diagnostics, not your rephrased
version.

Feb 23 '07 #4

P: n/a
santosh wrote:
RAKHE wrote:
>Hi
I am having some warning when i used like this
struct creat_table {
--------
----------
};
struct creat_table *table();
int main()
{
struct creat_table *p;
p =table();
}
struct creat_table *table()
{

}
I used to get Some warning like
Incompatible assignment Please if any body find solution can u
expalin it

If you want assistance, please post a minimal, compilable program that
exhibits your problem. Use cut and paste, don't retype. If relevant,
post the actual text of the compiler's diagnostics, not your rephrased
version.
Nitpick:

It's a but difficult to present a compilable example that produces
"incompatible assignment" messages, assuming that those are
constraint violations.

--
Chris "electric hedgehog" Dollin
"It's just the beginning we've seen" - Colosseum, /Tomorrow's Blues/

Feb 23 '07 #5

P: n/a
On Fri, 23 Feb 2007 00:06:33 -0800, jaysome wrote:

I'm really curious as to why you chose to name your struct "creat_table"
instead of "create_table". We had an incompetent programmer working for
us who chose to use the same naming convention, and we always wondered
why in the world he chose to omit the final 'e' in "create". I'm not
saying you're incompetent--I just want to know what your rationale is
behind choosing "creat" (which we pronounce "kreet") over "create".
OT: Ken Thompson said this about the creat() function call in Unix:

"If I had to do it over again? Hmm... I guess I'd spell 'creat' with an
'e'."

Maybe OP got the inspiration from Ken Thompson.

-Alok
Feb 23 '07 #6

P: n/a
u plz wrote:
On Fri, 23 Feb 2007 00:06:33 -0800, jaysome wrote:

I'm really curious as to why you chose to name your struct "creat_table"
instead of "create_table". We had an incompetent programmer working for
us who chose to use the same naming convention, and we always wondered
why in the world he chose to omit the final 'e' in "create". I'm not
saying you're incompetent--I just want to know what your rationale is
behind choosing "creat" (which we pronounce "kreet") over "create".

OT: Ken Thompson said this about the creat() function call in Unix:

"If I had to do it over again? Hmm... I guess I'd spell 'creat' with an
'e'."
He (Ken) said that in jest. There're far more cryptic calls like brk.

Feb 23 '07 #7

P: n/a
Op Fri, 23 Feb 2007 17:31:21 +0000 (UTC) schreef u plz:
On Fri, 23 Feb 2007 00:06:33 -0800, jaysome wrote:

>I'm really curious as to why you chose to name your struct "creat_table"
instead of "create_table". We had an incompetent programmer working for
us who chose to use the same naming convention, and we always wondered
why in the world he chose to omit the final 'e' in "create". I'm not
saying you're incompetent--I just want to know what your rationale is
behind choosing "creat" (which we pronounce "kreet") over "create".

OT: Ken Thompson said this about the creat() function call in Unix:

"If I had to do it over again? Hmm... I guess I'd spell 'creat' with an
'e'."

Maybe OP got the inspiration from Ken Thompson.
I use a language that would have been called Fourth if the compiler had
allowed six letter words ;-)
--
Coos
Feb 23 '07 #8

P: n/a
"santosh" <sa*********@gmail.comwrites:
u plz wrote:
>On Fri, 23 Feb 2007 00:06:33 -0800, jaysome wrote:
I'm really curious as to why you chose to name your struct "creat_table"
instead of "create_table". We had an incompetent programmer working for
us who chose to use the same naming convention, and we always wondered
why in the world he chose to omit the final 'e' in "create". I'm not
saying you're incompetent--I just want to know what your rationale is
behind choosing "creat" (which we pronounce "kreet") over "create".

OT: Ken Thompson said this about the creat() function call in Unix:

"If I had to do it over again? Hmm... I guess I'd spell 'creat' with an
'e'."

He (Ken) said that in jest. There're far more cryptic calls like brk.
But "break" is a keyword.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Feb 23 '07 #9

P: n/a
Coos Haak <ch*****@hccnet.nlwrites:
[...]
I use a language that would have been called Fourth if the compiler had
allowed six letter words ;-)
Fortran IV? 8-)}

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Feb 23 '07 #10

P: n/a
Keith Thompson wrote:
"santosh" <sa*********@gmail.comwrites:
u plz wrote:
On Fri, 23 Feb 2007 00:06:33 -0800, jaysome wrote:
I'm really curious as to why you chose to name your struct "creat_table"
instead of "create_table". We had an incompetent programmer working for
us who chose to use the same naming convention, and we always wondered
why in the world he chose to omit the final 'e' in "create". I'm not
saying you're incompetent--I just want to know what your rationale is
behind choosing "creat" (which we pronounce "kreet") over "create".

OT: Ken Thompson said this about the creat() function call in Unix:

"If I had to do it over again? Hmm... I guess I'd spell 'creat' with an
'e'."
He (Ken) said that in jest. There're far more cryptic calls like brk.

But "break" is a keyword.
Indeed. But brk itself is more heavily "abbreviated", (I can't come up
with a better term), than creat, (two vowels excised, destroying the
pronounciation, instead of one almost redundant one.)

Feb 23 '07 #11

P: n/a
"santosh" <sa*********@gmail.comwrites:
Keith Thompson wrote:
>"santosh" <sa*********@gmail.comwrites:
u plz wrote:
On Fri, 23 Feb 2007 00:06:33 -0800, jaysome wrote:
I'm really curious as to why you chose to name your struct
"creat_table" instead of "create_table". We had an incompetent
programmer working for us who chose to use the same naming
convention, and we always wondered why in the world he chose
to omit the final 'e' in "create". I'm not saying you're
incompetent--I just want to know what your rationale is behind
choosing "creat" (which we pronounce "kreet") over "create".

OT: Ken Thompson said this about the creat() function call in Unix:

"If I had to do it over again? Hmm... I guess I'd spell 'creat' with an
'e'."

He (Ken) said that in jest. There're far more cryptic calls like brk.

But "break" is a keyword.

Indeed. But brk itself is more heavily "abbreviated", (I can't come up
with a better term), than creat, (two vowels excised, destroying the
pronounciation, instead of one almost redundant one.)
Agreed, but spelling it out as "break" wasn't an option. I guess my
point (and it's a trivial one) is that Ken Thompson was probably
speaking in jest in that it was a humorous remark, but I suspect he
really did wish he had spelled "creat" with an 'e'. And dropping the
'e' from "create" does destroy the pronunciation.

This is all quite off-topic, of course.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Feb 24 '07 #12

P: n/a
Keith Thompson <ks***@mib.orgwrites:
"santosh" <sa*********@gmail.comwrites:
>He (Ken) said that in jest. There're far more cryptic calls like brk.

But "break" is a keyword.
As a side note, in the 6th Edition kernel, brk was named sbreak,
with this comment above it:

bad planning: "break" is a dirty word in C.
--
"IMO, Perl is an excellent language to break your teeth on"
--Micah Cowan
Feb 24 '07 #13

P: n/a
Ben Pfaff <bl*@cs.stanford.eduwrites:
Keith Thompson <ks***@mib.orgwrites:
>"santosh" <sa*********@gmail.comwrites:
>>He (Ken) said that in jest. There're far more cryptic calls like brk.

But "break" is a keyword.

As a side note, in the 6th Edition kernel, brk was named sbreak,
with this comment above it:

bad planning: "break" is a dirty word in C.
Modern Unixish systems have both brk() and sbrk().

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Feb 24 '07 #14

P: n/a
In article <ln************@nuthaus.mib.org>,
Keith Thompson <ks***@mib.orgwrote:
>Agreed, but spelling it out as "break" wasn't an option. I guess my
point (and it's a trivial one) is that Ken Thompson was probably
speaking in jest in that it was a humorous remark, but I suspect he
really did wish he had spelled "creat" with an 'e'. And dropping the
'e' from "create" does destroy the pronunciation.
The nature of the remark is clear if you know the context. Thompson
was asked what he would do differently if he were designing Unix
today.

-- Richard
--
"Consideration shall be given to the need for as many as 32 characters
in some alphabets" - X3.4, 1963.
Feb 24 '07 #15

P: n/a
In article <ln************@nuthaus.mib.org>,
Keith Thompson <ks***@mib.orgwrote:
>As a side note, in the 6th Edition kernel, brk was named sbreak,
with this comment above it:

bad planning: "break" is a dirty word in C.
>Modern Unixish systems have both brk() and sbrk().
That was true in V6 too. But sbreak() in V6 was the system call used
by both of them. It corresponds more directly to brk() than sbrk().

You can see the code at
ftp://ftp.win.tue.nl/pub/home/aeb/un...DP-11/Trees/V6
in
usr/sys/ken/sys1.c
and
usr/source/s5/sbrk.s

-- Richard
--
"Consideration shall be given to the need for as many as 32 characters
in some alphabets" - X3.4, 1963.
Feb 24 '07 #16

P: n/a
Keith Thompson wrote:
>
.... snip ...
>
Agreed, but spelling it out as "break" wasn't an option. I guess
my point (and it's a trivial one) is that Ken Thompson was probably
speaking in jest in that it was a humorous remark, but I suspect he
really did wish he had spelled "creat" with an 'e'. And dropping
the 'e' from "create" does destroy the pronunciation.
The last time I was in Northern Quebec I watched as the Cree ate
their venison and fish :-)

--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net>

Feb 24 '07 #17

P: n/a
Coos Haak <ch*****@hccnet.nlwrote:
Op Fri, 23 Feb 2007 17:31:21 +0000 (UTC) schreef u plz:
OT: Ken Thompson said this about the creat() function call in Unix:

"If I had to do it over again? Hmm... I guess I'd spell 'creat' with an
'e'."

Maybe OP got the inspiration from Ken Thompson.

I use a language that would have been called Fourth if the compiler had
allowed six letter words ;-)
I once used a language whose name is a four-letter word.

Richard
Feb 26 '07 #18

This discussion thread is closed

Replies have been disabled for this discussion.