Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Structure Pointer

Reply
Thread Tools

Structure Pointer

 
 
RAKHE
Guest
Posts: n/a
 
      02-23-2007
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

 
Reply With Quote
 
 
 
 
Keith Thompson
Guest
Posts: n/a
 
      02-23-2007
"RAKHE" <(E-Mail Removed)> writes:
> 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) http://www.velocityreviews.com/forums/(E-Mail Removed) <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.
 
Reply With Quote
 
 
 
 
jaysome
Guest
Posts: n/a
 
      02-23-2007
On 22 Feb 2007 20:42:19 -0800, "RAKHE" <(E-Mail Removed)>
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
 
Reply With Quote
 
santosh
Guest
Posts: n/a
 
      02-23-2007
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.

 
Reply With Quote
 
Chris Dollin
Guest
Posts: n/a
 
      02-23-2007
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/

 
Reply With Quote
 
u plz
Guest
Posts: n/a
 
      02-23-2007
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
 
Reply With Quote
 
santosh
Guest
Posts: n/a
 
      02-23-2007
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.

 
Reply With Quote
 
Coos Haak
Guest
Posts: n/a
 
      02-23-2007
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
 
Reply With Quote
 
Keith Thompson
Guest
Posts: n/a
 
      02-23-2007
"santosh" <(E-Mail Removed)> writes:
> 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) (E-Mail Removed) <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.
 
Reply With Quote
 
Keith Thompson
Guest
Posts: n/a
 
      02-23-2007
Coos Haak <(E-Mail Removed)> writes:
[...]
> I use a language that would have been called Fourth if the compiler had
> allowed six letter words


Fortran IV? }

--
Keith Thompson (The_Other_Keith) (E-Mail Removed) <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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple structure and copying data to pointer of the same structure A C++ 27 04-16-2011 11:07 PM
Pointer to pointer Vs References to Pointer bansalvikrant@gmail.com C++ 4 07-02-2009 10:20 AM
pointer to structure from pointer to member sieg1974@yahoo.com C Programming 6 08-27-2006 01:20 AM
passing the address of a pointer to a func that doesnt recieve a pointer-to-a-pointer jimjim C Programming 16 03-27-2006 11:03 PM
Pointer-to-pointer-to-pointer question masood.iqbal@lycos.com C Programming 10 02-04-2005 02:57 AM



Advertisments