473,806 Members | 2,787 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

obj function hello()

#include <stdio.h>

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.dat a);
}

I don't know much c and i was hoping the code above was pointing out
what i am trying to do ?

Feb 9 '07
40 2320
On 11 Feb 2007 16:16:55 -0800, in comp.lang.c , "gert"
<ge**********@g mail.comwrote:
>On Feb 11, 10:49 pm, Mark McIntyre <markmcint...@s pamcop.netwrote :
>On 11 Feb 2007 07:19:37 -0800, in comp.lang.c , "gert"

<gert.cuyk...@ gmail.comwrote:
>Thanks :) I modified again this time i a cgi example

If you want an OO language, why not use C++ ? C is not designed for
this, and while you can indeed do it, why reinvent the wheel?

Because then i know how the wheel works, trying to do everything in c
is frustrating but you defenatly learn allot about how your pc works.
Fine, but before you try programming complicated stuff in C, why not
learn to programme easy stuff first? When you're learning to drive, do
you jump into a huge lorry and just fiddle with the controls?


--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
Feb 12 '07 #41

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
6531
by: George Sakkis | last post by:
Is there a general way of injecting code into a function, typically before and/or after the existing code ? I know that for most purposes, an OO solution, such as the template pattern, is a cleaner way to get the same effect, but it's not always applicable (e.g. if you have no control over the design and you are given a function to start with). In particular, I want to get access to the function's locals() just before it exits, i.e....
4
2058
by: veereshai | last post by:
i want to copy the functions from my source file into a new file...and convert each function into a new object file by compiling it. now, i want to invoke the function using the object file i have created and not by invoking the original function(i.e delete the part which has the function and then try to invoke the same function by including the object file into my source code). Is this possible?
5
8634
by: Sakharam Phapale | last post by:
Hi All, I am using an API function, which takes file path as an input. When file path contains special characters (@,#,$,%,&,^, etc), API function gives an error as "Unable to open input file". Same file path containing special characters works fine in one machine, but doesn't work in other. I am using following API function to get short file path. Declare Auto Function GetShortPathName Lib "kernel32" (ByVal lpszLongPath As
5
1985
by: Ian Bicking | last post by:
I got a puzzler for y'all. I want to allow the editing of functions in-place. I won't go into the reason (it's for HTConsole -- http://blog.ianbicking.org/introducing-htconsole.html), except that I really want to edit it all in-process and in-memory. So I want the identity of the function to remain the same, even as I edit the body and hopefully the signature too. Well, the reason is that I want to edit any function object, without...
54
24548
by: John | last post by:
Is the following program print the address of the function? void hello() { printf("hello\n"); } void main() { printf("hello function=%d\n", hello); }
27
3135
by: Terry | last post by:
I am getting the following warning for the below function. I understand what it means but how do I handle a null reference? Then how do I pass the resulting value? Regards Warning 1 Function 'Dec2hms' doesn't return a value on all code paths. A null reference exception could occur at run time when the result is used.
3
3665
by: John Turner | last post by:
typedef void (*vfp)(); typedef vfp (*fp)(); static fp hello() { printf("Hello.\n"); return (fp)&hello; } main(){
3
9291
pbmods
by: pbmods | last post by:
AN INTRODUCTION TO FUNCTION OBJECTS LEVEL: INTERMEDIATE PREREQS: OBJECTS You've seen it before. You're setting up an XMLHttpRequest call, and you need to execute a function when it returns, so you do something like this: http.onreadystatechange = myAwesomeFunction;
5
1499
by: robbiesmith79 | last post by:
Hey fellow nerds, Take this code for example: class hello { function world() { echo "Hello"; } }
1
2396
by: Hunter | last post by:
I am writing a script that needs to send some emails. And I've used smtplib in the past and it is pretty easy. But I thought, gee it would be easier if I could just call it as a function, passing the from, to, subject, and message text. So I wrote it up as a function and it sort of works, but I get a weird error. When it runs it inserts a "\t" tab character before each item during the send portion (which I can see when I turn on...
0
9599
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10624
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10371
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9193
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7650
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5546
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5684
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3853
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3010
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.