S
SSG
How to write a object oriented program in c? give me one example....
SSG said:How to write a object oriented program in c? give me one example....
lampard said:#include<stdio.h>
struct A
{
public:
How to write a object oriented program in c? give me one example....
SSG said:How to write a object oriented program in c? give me one example....
lampard said:I had compiled on vc++ and looks ok, can you please explain what is
wrong...
lampard said:I had compiled on vc++ and looks ok, can you please explain what is
wrong... hope I can pick one or two points from you...
>
>Syntax error. BOOM.
I had compiled on vc++ and looks ok, can you please explain what is
wrong... hope I can pick one or two points from you...
#include<stdio.h>
struct A
{
public:
A(){ printf(" A:: constructor \n"); }
~A(){ printf(" A:: destructor \n"); }
void print(){ printf(" A:rint \n"); }
};
int main(int argc, char* argv[])
{
A a;
a.print();
printf("Hello World!\n");
return 0;
}
use struct, only difference from class to struct is all the methods and
variables in struct are public by default ....
SSG said:How to write a object oriented program in c? give me one example....
lampard said:I had compiled on vc++ and looks ok, can you please explain what is
wrong... hope I can pick one or two points from you...
I was not complaining, I was requesting information.. You better go forFlash said:Provide context. Even with google this is possible and instructions get
posted MULTIPLE TIMES MOST DAYS. No go and complain at google for them
changing there interface to something that encouraged you to do the
wrong thing and get complained at.
lampard said:I was not complaining, I was requesting information.. You better go for
a crash course in english because your english sucks.. look at your
phrase "No go and complain ..".
Thank you friend, Thank you for your advice. Sorry Jordon for jumpingKeith said:Yes, he wrote "No" where he meant "Now" several times. I don't know
why, but we don't usually jump on typos (unless they're in C code and
therefore significant).
His point, I think, is that you *should* be complaining to Google
about their broken Usenet interface. It apparently led you to make
the same mistake that far too many others have made here, posting
followups with no context. I'm truly delighted to see that you've now
corrected that.
As for your original followup, you're probably aware by now that what
you posted was C++ code, not C, and therefore both off-topic here and
not a response to the original question. (If, as I said, you're
already aware of that, feel free to ignore this paragraph.)
Thank you friend, Thank you for your advice. Sorry Jordon
heh
> for jumping
into early conclusion. I am here to learn from experienced persons, but
not to discourage people over here.
Eric said:SSG wrote:
I found the following helpful when I wanted to add some object-like behavior
to a project in C:
http://www.planetpdf.com/codecuts/pdfs/ooc.pdf
SSG said:How to write a object oriented program in c? give me one example....
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.