Structure Pointer

R

RAKHE

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
 
K

Keith Thompson

RAKHE said:
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.
 
J

jaysome

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
 
S

santosh

RAKHE said:
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.
 
C

Chris Dollin

santosh said:
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.
 
U

u plz

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
 
S

santosh

u said:
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.
 
C

Coos Haak

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 ;-)
 
S

santosh

Keith said:
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.)
 
K

Keith Thompson

santosh said:
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.
 
B

Ben Pfaff

Keith Thompson said:
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.
 
K

Keith Thompson

Ben Pfaff said:
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().
 
C

CBFalconer

Keith said:
.... 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 :)
 
R

Richard Tobin

Keith Thompson said:
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
 
R

Richard Tobin

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.
[/QUOTE]
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/unix-archive/UnixArchive/PDP-11/Trees/V6
in
usr/sys/ken/sys1.c
and
usr/source/s5/sbrk.s

-- Richard
 
R

Richard Bos

Coos Haak said:
Op Fri, 23 Feb 2007 17:31:21 +0000 (UTC) schreef u plz:


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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top