Re: obj function hello()
- From: Ian Collins <ian-news@xxxxxxxxxxx>
- Date: Fri, 09 Feb 2007 13:08:32 +1300
gert wrote:
#include <stdio.h>You are attempting to write something almost, but not entirely, unlike
obj function hello(){
struct obj = { char *data = 'hello'}
obj.add = obj_add(obj);
return obj;
}
void function obj_add(obj){
obj function add(value){
obj.data += value;
return obj;
}
}
void main(){
test = hello();
test.add('world');
printf(test.data);
}
I don't know much c and i was hoping the code above was pointing out
what i am trying to do ?
C. It is more like JavaScript.
You can't bind functions (or anything else) to structs at runtime in C.
--
Ian Collins.
.
- Follow-Ups:
- Re: obj function hello()
- From: gert
- Re: obj function hello()
- References:
- obj function hello()
- From: gert
- obj function hello()
- Prev by Date: obj function hello()
- Next by Date: Re: obj function hello()
- Previous by thread: obj function hello()
- Next by thread: Re: obj function hello()
- Index(es):
Relevant Pages
|