On Wed, 2004-09-22 at 07:24, Paul Akkermans wrote:
> Hi group,
>
> I have constructed the following code:
> struct node
> { TreeElementType elt;
>struct node *left, *right;
> };
> typedef struct node Node;
>
> typedef Node *Tree;
>
> #include
> #include "tree.h"
>
> void WriteTreeSla
On Wednesday 22 September 2004 17:24,
[EMAIL PROTECTED] wrote:
> int main (){
> WriteTreeSlave("paul",0);
> }
> ---
>
>-- It is my goal
> I have constructed the following code:
> Can anybody help me?
You're on the wrong list. Try comp.lang.c.
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Hi group,
I have constructed the following code:
-
#include "TreeElement.h"
struct node { TreeElementType
elt; struct node *left, *right; };typedef struct
node Node
On Wed, 06 Aug 2003 06:00:11 +0200, MJM wrote:
> On Monday 04 August 2003 21:40, Sebastian Kapfer wrote:
>> > // change the way it is accessed to prove a point int * p_b = (int
>> >*) p_a;
>>
>> Ouch.
>
> Try this in /usr/src/linux/kernel
>
> $ grep *\) *.c
This is unfair. First, it's kernel-l
On Wed, 06 Aug 2003 19:00:11 +0200, MJM wrote:
> I learned last night that there is a 3rd Ed. Evidently things have
> changed and the complex language has gotten more complex -
Right.
> trying to be all things to all people. If this continues, C++ will be
> too complex for normal programmers.
On Mon, 04 Aug 2003 05:00:12 +0200, MJM wrote:
> Will the free store be properly maintained when the following is
> executed? // a simple object is defined typedef struct {
>uint32_t a;
>uint64_t b;
>uint8_tc;
> } t_my_type;
No typedef needed. This is C++.
struct t_my_type
{
> "Al" == Al Davis <[EMAIL PROTECTED]> writes:
Al> Since you didn't say what uint64_t is, let me make a diabolical
Al> definition of it.
uint64_t is a type defined in C99, which is always a 64-bit unsigned
integer. Whether it is already in your C++ compiler depends pretty much on
pla
--jq0ap7NbKX2Kqbes
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
On Wed, Aug 06, 2003 at 10:36:42AM -0400, MJM wrote:
> On Wednesday 06 August 2003 01:02, Dave Carrigan wrote:
> > >?Language experts sure get their shorts knotted
On Tue, Aug 05, 2003 at 03:40:42AM +0200, Sebastian Kapfer wrote:
> On Mon, 04 Aug 2003 05:00:12 +0200, MJM wrote:
> > // change the way it is accessed to prove a point int * p_b = (int *)
> > p_a;
> > // p_a and p_b point to the same block of dyn. allocated memory;
>
> Do they? Watch out for inhe
On Tuesday 05 August 2003 14:02, Pigeon wrote:
> On Tue, Aug 05, 2003 at 03:40:42AM +0200, Sebastian Kapfer wrote:
> > On Mon, 04 Aug 2003 05:00:12 +0200, MJM wrote:
> > > // change the way it is accessed to prove a point int * p_b = (int *)
> > > p_a;
> > > // p_a and p_b point to the same block o
On Wednesday 06 August 2003 09:30, Sebastian Kapfer wrote:
> > They do. My app would be broken from the start if I could not rely on
> > this capability. This style of type conversion is covered in elementary
> > C++ books by Bjarne. It's not unusual.
>
> Exactly where? I don't remember such cast
On Wed, Aug 06, 2003 at 10:36:42AM -0400, MJM wrote:
> On Wednesday 06 August 2003 01:02, Dave Carrigan wrote:
> > > Language experts sure get their shorts knotted up over simple questions.
> > >
> >
> > Because your question had to do with undefined and
> > implementation-dependent behavior.
>
On Tue, 05 Aug 2003 22:00:13 +0200, Pigeon wrote:
>> No. You have to delete the original pointer (with the original type).
>> Everything else is undefined behaviour, i.e. it could work, it could
>> leak memory (completely or partly), it could crash, or even print "42".
>> It might even work someti
* Pigeon ([EMAIL PROTECTED]) [030805 12:52]:
> On Tue, Aug 05, 2003 at 03:40:42AM +0200, Sebastian Kapfer wrote:
> > On Mon, 04 Aug 2003 05:00:12 +0200, MJM wrote:
> > > I think the free store will be maintained properly because there is a
> > > control block attached to the allocated block of stor
On Monday 04 August 2003 21:40, Sebastian Kapfer wrote:
> > // change the way it is accessed to prove a point int * p_b = (int *)
> > p_a;
>
> Ouch.
Try this in /usr/src/linux/kernel
$ grep *\) *.c
>
> > // p_a and p_b point to the same block of dyn. allocated memory;
>
> Do they?
They do. My
On Wednesday 06 August 2003 15:20, Sebastian Kapfer wrote:
> You obviously don't understand the point of the new cast operators. They
> don't take power away from you, in fact they give you more power than
> before
I didn't _know_ about the new cast operators and yet things
are working very well
I think all of the responses are missing something very
important. Let me try
On Sunday 03 August 2003 08:57 pm, MJM wrote:
> Will the free store be properly maintained when the following
> is executed? // a simple object is defined
> typedef struct
> {
>uint32_t a;
>uint64_t b;
On Wed, Aug 06, 2003 at 03:30:57PM +0200, Sebastian Kapfer wrote:
> On Wed, 06 Aug 2003 06:00:11 +0200, MJM wrote:
> > That was way over the top. That stuff is for compiler writers, not
> > application programmers. I did not start a knowledge contest. If I did
> > inadvertently, then you win.
>
>
> "MJM" == MJM <[EMAIL PROTECTED]> writes:
MJM> They do. My app would be broken from the start if I could not rely
MJM> on this capability. This style of type conversion is covered in
MJM> elementary C++ books by Bjarne. It's not unusual. You must be
MJM> aware of what you
On Wednesday 06 August 2003 01:02, Dave Carrigan wrote:
> > Language experts sure get their shorts knotted up over simple questions.
> >
>
> Because your question had to do with undefined and
> implementation-dependent behavior.
I know that. See my other posts. I asked a question about handli
On Tue, Aug 05, 2003 at 11:21:04PM -0400, MJM wrote:
> On Monday 04 August 2003 21:40, Sebastian Kapfer wrote:
> > > // change the way it is accessed to prove a point int * p_b = (int *)
> > > p_a;
> >
> > Ouch.
>
> Try this in /usr/src/linux/kernel
>
> $ grep *\) *.c
Well, C is not C++, so grep
On Sun, Aug 03, 2003 at 10:57:21PM -0400, MJM wrote:
> Will the free store be properly maintained when the following is executed?
Yes.
--
Pigeon
Be kind to pigeons
Get my GPG key here: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x21C61F7F
pgp0.pgp
Description: PGP signature
Will the free store be properly maintained when the following is executed?
// a simple object is defined
typedef struct
{
uint32_t a;
uint64_t b;
uint8_t c;
} t_my_type;
// allocate some memory for an instance of this object
t_my_type * p_a = (t_my_type) new t_my_type;
// chan
On Wed, 5 Mar 2003 09:29:15 -0500
Kevin Coyner <[EMAIL PROTECTED]> wrote:
> Second, question about how to best set up the dual compilers: Like
> you, I'll use 2.95 to compile downloaded software, and 3.2 for stuff
> I write. Do you change the symlink in /usr/bin depending upon what
> you are doi
On Wed, Mar 05, 2003 at 03:21:39PM +0200, Alaa The Great wrote..
> AFAIK GCC 2.95 doesn't have the ios_base namespace , you'll have to
> use ios instead.
>
> however boolalpha is not implemented in 2.95, so you'll have install
> g++-3.2 (only in testing I believe).
>
> if you plan on lear
On Wed, 5 Mar 2003 07:33:19 -0500
Kevin Coyner <[EMAIL PROTECTED]> wrote:
>
> I'm learning C++ and ran into a bit of difficulty with boolalpha.
>
> I guess I don't have all the right libraries loaded (although I
> would have thought this one was quite basic) because the following
> doesn't work:
I'm learning C++ and ran into a bit of difficulty with boolalpha.
I guess I don't have all the right libraries loaded (although I would
have thought this one was quite basic) because the following doesn't
work:
cout.setf(ios_base::boolalpha); // from textbook
The err msg I get is:
`ios_base'
* Shao Zhang <[EMAIL PROTECTED]> writes:
> The code was originally written by someone else, and I had to modify it.
> It uses a whole bunch of libraries written in C. And I am too lazy to
> port it to C++. So I had to use both gcc and g++. But it is just a pain
> to keep the memory allocation cons
Noah L. Meyerhans [EMAIL PROTECTED] wrote:
> -BEGIN PGP SIGNED MESSAGE-
>
> On Tue, 15 Feb 2000, Shao Zhang wrote:
>
> > Eg. if I compile with this:
> > $ g++ -g -c misc.c
> > misc.c: In function `char * cash(double, int, int)':
> > misc.c:44: implicit declaration of function `int bracket
-BEGIN PGP SIGNED MESSAGE-
On Tue, 15 Feb 2000, Shao Zhang wrote:
> Eg. if I compile with this:
> $ g++ -g -c misc.c
> misc.c: In function `char * cash(double, int, int)':
> misc.c:44: implicit declaration of function `int bracket(...)'
> misc.c:45: implicit declaration of function `int c
Bryan Scaringe [EMAIL PROTECTED] wrote:
> It is my understandng that in order for C++ to "delete" a
> dynamically-allocated
> object, that object need to have been created via "new".
>
> That said, I'd like to see the code where you do the allocation.
You are right. the memory allocation is done
It is my understandng that in order for C++ to "delete" a dynamically-allocated
object, that object need to have been created via "new".
That said, I'd like to see the code where you do the allocation.
Also, you may need to type-cast the void pointer. The new compiler version
may be more picky a
Hi,
I have posted this to comp.lang.c++, but hope someone here can
help me as well. Thanks.
=
I have a c++ program that compiles fine with
earlier version of g++, but it no longer compiles with
the newsest release 2.95.2.
Here i
The man page for TCSH shows how to check permissions within a TCSH script.
try searching for filetest.
On Tue, 16 Mar 1999, richard wrote:
>
>
> I know this is the wrong place to ask, so I've got two questions now. What is
> a good unix/C
> newsgroup? I think I'm gonna need some help. Now my
Quoting richard ([EMAIL PROTECTED]):
> I've got a perl script that checks the permissions and creates directories.
> Now I want to rewrite
> the script in C. I know nothing about checking permissions nor creating
> directories with C. I
> don't even know if it's possible, so if someone does know
> I've got a perl script that checks the permissions and creates
> directories. Now I want to rewrite the script in C. I know nothing
> about checking permissions nor creating directories with C. I don't
> even know if it's possible, so if someone does know how to do this or a
> place that might
>[EMAIL PROTECTED] (richard)
>
> I know this is the wrong place to ask, so I've got two questions
> now. What is a good unix/C newsgroup? I think I'm gonna need some
For general C, try comp.lang.c. It's probably the wrong place
for these questions, since they are UNIX specific.
comp.unix.programm
Try the comp.lang.c newsgroup for C questions.
For creating directories, try
#include
int mkdir(const char *path, mode_t mode);
For removing directories,
#include
int rmdir(const char *path);
Also see man 3 ...
opendir
closedir
telldir
I know this is the wrong place to ask, so I've got two questions now. What is a
good unix/C
newsgroup? I think I'm gonna need some help. Now my real question.
I've got a perl script that checks the permissions and creates directories. Now
I want to rewrite
the script in C. I know nothing abou
ogram was bigger and you wanted to be frugal with memory:
when
your done using 'thisTime'*/
delete thisTime; /*Don't use thisTime anymore unless you reallocate, or you're
making a dangling pointer mistake*/
This is really a C question though, there is lots of good literature on being
> This is a multi-part message in MIME format.
Why?
Peter wrote:
> stdio is in /usr/include however; the compiler, by default
> should be looking there via #define. Therefore
Um, make that #include , OK ? :^|
Eric
--
E.L. Meijer ([EMAIL P
Date: July 25, 1998 8:56 AM
Subject: Newbie C Question
> I've never written C for any UNIX but want very
>much to learn. Getting started might be the most
>difficult part. The following question appears to me
>to be a somewhat Debian-Linux-specific (although I could
>b
Art Lemasters wrote:
> I've never written C for any UNIX but want very
>much to learn. Getting started might be the most
>difficult part. The following question appears to me
>to be a somewhat Debian-Linux-specific (although I could
>be wrong).
>
> How do I compile and link
I've never written C for any UNIX but want very
much to learn. Getting started might be the most
difficult part. The following question appears to me
to be a somewhat Debian-Linux-specific (although I could
be wrong).
How do I compile and link hello.c? ...can't
seem to find stdio.h fo
45 matches
Mail list logo