473,765 Members | 1,909 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Having C code looking like C++ code

Hi,
I've been asked in a job interview how to make C code look like C++
code, and honestly I didn't know what to answer because I have never really
done a lot of C. Now, I've been searching around the web about web sites
that talk about this subject, but I've had no luck. Can anyone point me to
some web site about this subject? Thanks a lot!
Nov 13 '05
16 2293
Fronsac wrote:
You posted the same question with slightly different subject lines
to (at least) a.c.l.l.c-c++ and c.l.c.
Yeah, I was too lazy to copy-paste the subject line from the other post.


Lazy doesn't win friends on Usenet - at least, not when the lazy person is
the one asking for help.
I
posted in two forums just to be sure at least one person answered me. :)
If you feel the need to post to more than one news-group, please
cross-post rather than multi-post. Thank you.


What is cross-post? Could you explain me what it is and how to do it?


Cross-posting is the posting of one article to more than one newsgroup
(rather than posting two identical articles to one newsgroup each). Typical
newsreaders allow you to do this by typing more than one group name into
the "Groups" header when you are creating your article.

The reason for cross-posting is that it allows newsreaders to deal
intelligently with the thread when a reader (such as myself) subscribes to
/both/ the newsgroups to which you have cross-posted. Having presented your
article to me in one group, it would not bother to do so in the second,
because it would "know" that I'd already read the article.

When you post identical articles with separate message IDs in separate
groups (as you did this time around), the newsreader can't legitimately
associate them, so it doesn't. This costs your readers time. Incurring
unnecessary costs of your readers is not a good idea when /you/ are asking
/them/ for help.

--
Richard Heathfield : bi****@eton.pow ernet.co.uk
"Usenet is a strange place." - Dennis M Ritchie, 29 July 1999.
C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
K&R answers, C books, etc: http://users.powernet.co.uk/eton
Nov 13 '05 #11
> Cross-posting is the posting of one article to more than one newsgroup
(rather than posting two identical articles to one newsgroup each). Typical newsreaders allow you to do this by typing more than one group name into
the "Groups" header when you are creating your article.


Thanks a lot. I'm not sure Outlook Express does this, but Outlook is only a
temporary solution anyway. Thanks for the info.
Nov 13 '05 #12
"Fronsac" <fr************ *@hotmail.com> wrote in message
news:bU******** ************@we ber.videotron.n et...
Cross-posting is the posting of one article to more than one newsgroup
(rather than posting two identical articles to one newsgroup each).

Typical
newsreaders allow you to do this by typing more than one group name into
the "Groups" header when you are creating your article.


Thanks a lot. I'm not sure Outlook Express does this,


Yes, Outlook Express does handle crossposts correctly
as far as I can tell.

-Mike
Nov 13 '05 #13

"Fronsac" <fr************ *@hotmail.com> wrote in message
news:bU******** ************@we ber.videotron.n et...
Cross-posting is the posting of one article to more than one newsgroup (rather than posting two identical articles to one newsgroup each).
Typical
newsreaders allow you to do this by typing more than one group
name into the "Groups" header when you are creating your article.


Thanks a lot. I'm not sure Outlook Express does this, but Outlook is

only a temporary solution anyway. Thanks for the info.


Outlook Express does support cross-posting. If you click "Newsgroups "
(the icon and label, not the text-box to it's right) a dialog will
appear. Here you can select one or more destination groups.
Alternatively, you can type them in the text-box separated by commas,
if you really want. If you do cross-post, you might also want to set
up where follow-ups to your post are sent, rather than have them
bounce around all of the groups (why have a potentially huge
conversation appear in multiple groups?). To do this, select "All
Headers" from the "View" menu then use the "Followup-To" section like
the "Newgroups" section, but only add one newgroup (the most
appropriate for your question is probably best). You can ignore the
other sections it adds (except "Subject", of course).

Mike

--
Michael Winter
M.Winter@[no-spam]blueyonder.co.u k (remove [no-spam] to reply)
Nov 13 '05 #14
On 2003-10-12, Fronsac <fr************ *@hotmail.com> wrote:
I've been asked in a job interview how to make C code look like C++
code, and honestly I didn't know what to answer because I have never
really done a lot of C. Now, I've been searching around the web about
web sites that talk about this subject, but I've had no luck. Can
anyone point me to some web site about this subject? Thanks a lot!


Let's consider a simple example: providing an integer stack.

Here's a typical way of doing it:

+---
| /* -- stack.h -- */
| extern int push(int value);
| extern int pop(int *value);
| extern void popall(void);
+---
| /* -- stack.c -- */
| #include "stack.h"
|
| #define MAX_STACK 100
| static int stack[MAX_STACK];
| static unsigned count;
|
| int push(int value) {
| if (count >= MAX_STACK) return -1;
| stack[count++] = value;
| return 0;
| }
|
| int pop(int *value) {
| if (count == 0) return -1;
| *value = stack[--count];
| return 0;
| }
|
| void popall(void) {
| count = 0;
| }
+---

There may be other deficiencies with this implementation, but at least
one of them is that any application that uses this implementation is
limited to only one stack. There are various ways of addressing this
issue, but one of the most short sighted ways is to simply copy off
stack.c to another file stack2.c and rename the functions push2 and
pop2 to create a second stack.

Better is to encapsulate the stack in a structure so that an
application can create as many stacks as it needs without having to
apply cut and paste coding.

+---
| /* -- stack.h -- */
| #define MAX_STACK 100
| typedef struct stacktype {
| int stack[MAX_STACK];
| unsigned count;
| } stacktype;
|
| extern int push(stacktype *s, int value);
| extern int pop(stacktype *s, int *value);
| extern void popall(stacktyp e *s);
+---
| /* -- stack.c -- */
| #include "stack.h"
|
| int push(stacktype *s, int value) {
| if (s->count >= MAX_STACK) return -1;
| s->stack[s->count++] = value;
| return 0;
| }
|
| int pop(stacktype *s, int *value) {
| if (s->count == 0) return -1;
| *value = s->stack[--s->count];
| return 0;
| }
|
| void popall(stacktyp e *s) {
| s->count = 0;
| }
+---

This implementation is sufficient for most applications needing an
integer stack. However, another minor drawback is that all stacks
are always of the same size. In order to avoid the cut and paste
solution to allow different sized stacks, this property should also be
encapsulated within the stack data structure. However, now the stack
implementation is exposed to the extent that users of the interface must
muck around inside the encapsulation to use the interface. In order to
decouple the interface from the implementaiton, we make the stacktype
opaque. The result provides a limited form of polymorphism, since
the stack interface client need not be aware of how the stack was
created to use the stack.

+---
| /* -- stack.h -- */
| typedef struct stacktype stacktype;
|
| extern stacktype *create_bounded _stack(unsigned stacksize);
| extern void destroy_stack(s tacktype *s);
|
| extern int push(stacktype *s, int value);
| extern int pop(stacktype *s, int *value);
| extern void popall(stacktyp e *s);
+---
| /* -- stack.c -- */
| #include <stdlib.h>
| #include "stack.h"
|
| struct stacktype {
| unsigned max_stack;
| unsigned count;
| int stack[];
| };
|
| int push(stacktype *s, int value) {
| if (s->count >= s->max_stack) return -1;
| s->stack[s->count++] = value;
| return 0;
| }
|
| int pop(stacktype *s, int *value) {
| if (s->count == 0) return -1;
| *value = s->stack[--s->count];
| return 0;
| }
|
| void popall(stacktyp e *s) {
| s->count = 0;
| }
|
| void destroy_stack(s tacktype *s) {
| free(s);
| }
|
| stacktype *create_bounded _stack(unsigned stacksize) {
| stacktype *s;
| if (stacksize == 0) return 0;
| s = malloc(sizeof(s tacktype) + stacksize*sizeo f(int));
| if (s != 0) {
| s->max_stack = stacksize;
| s->count = 0;
| }
| return s;
| }
+---

The final point we will address is that the interface only provides
a bounded stack implementation. Suppose an application is utilizing
the stack in multiple modules. In some modules, the bounded stack
is required, because it is used to throttle the work load. In other
modules, it has been determined that a bounded stack is unacceptable,
since pre-allocating the maximum required memory is too wasteful, and
and the most common cases only require a small amount of memory.

Again, one could perform cut and paste, rename the stack interfaces
for an unbounded implementation, and alter the modules that need the
unbounded implementation to use the new interface. However, to avoid
the pitfalls of cut and paste programming, an alternative solution
is to make the interface inheritable and extensible. Then, applying
reuse on the interface, implement the unbounded stack.

+---
| /* -- stack.h -- */
| typedef struct stacktype stacktype;
| struct stacktype {
| int (*push)(stackty pe *s, int value);
| int (*pop)(stacktyp e *s, int *value);
| void (*popall)(stack type *s);
| void (*destroy)(stac ktype *s);
| };
|
| static inline int push(stacktype *s, int value) {return s->push(s, value);}
| static inline int pop(stacktype *s, int *value) {return s->pop(s, value);}
| static inline void popall(stacktyp e *s) {s->popall(s);}
| static inline void destroy_stack(s tacktype *s) {s->destroy(s);}
+---
| /* -- bounded_stack.h -- */
| #include "stack.h"
| extern stacktype *create_bounded _stack(unsigned stacksize);
+---
| /* -- bounded_stack.c -- */
| #include <stdlib.h>
| #include "bounded_stack. h"
|
| typedef struct bounded_stackty pe {
| stacktype interface;
| unsigned max_stack;
| unsigned count;
| int stack[];
| } bounded_stackty pe;
|
| static int bounded_push(st acktype *s, int value) {
| bounded_stackty pe *bs = (void *)s;
| if (bs->count >= bs->max_stack) return -1;
| bs->stack[bs->count++] = value;
| return 0;
| }
|
| static int bounded_pop(sta cktype *s, int *value) {
| bounded_stackty pe *bs = (void *)s;
| if (bs->count == 0) return -1;
| *value = bs->stack[--bs->count];
| return 0;
| }
|
| static void bounded_popall( stacktype *s) {
| bounded_stackty pe *bs = (void *)s;
| bs->count = 0;
| }
|
| static void destroy_bounded _stack(stacktyp e *s) {
| free(s);
| }
|
| static const stacktype bounded_stack_i nterface = {
| bounded_push,
| bounded_pop,
| bounded_popall,
| destroy_bounded _stack,
| };
|
| stacktype *create_bounded _stack(unsigned stacksize) {
| bounded_stackty pe *bs;
| if (stacksize == 0) return 0;
| bs = malloc(sizeof(b ounded_stacktyp e) + stacksize*sizeo f(int));
| if (bs == 0) return 0;
| bs->interface = bounded_stack_i nterface;
| bs->max_stack = stacksize;
| bs->count = 0;
| return &bs->interface;
| }
+---
| /* -- unbounded_stack .h -- */
| #include "stack.h"
| extern stacktype *create_unbound ed_stack(void);
+---
| /* -- unbounded_stack .c -- */
| #include <stdlib.h>
| #include "unbounded_stac k.h"
| #include "bounded_stack. h"
|
| #define UB_STACK_DEFAUL T 100
| static unsigned UB_STACK_SIZE = UB_STACK_DEFAUL T;
|
| typedef struct unbounded_subst acktype {
| struct unbounded_subst acktype *link;
| stacktype *substack;
| } unbounded_subst acktype;
|
| static unbounded_subst acktype *create_unbound ed_substack(voi d) {
| unbounded_subst acktype *s;
| s = malloc(sizeof(u nbounded_substa cktype));
| if (s == 0) return 0;
| s->substack = create_bounded_ stack(UB_STACK_ SIZE);
| if (s->substack == 0) {
| free(s);
| return 0;
| }
| s->link = 0;
| return s;
| }
|
| static void destroy_unbound ed_substack(unb ounded_substack type *s) {
| destroy_stack(s->substack);
| free(s);
| }
|
| typedef struct unbounded_stack type {
| stacktype interface;
| unbounded_subst acktype *current_stack;
| unbounded_subst acktype *free_stack;
| } unbounded_stack type;
|
| static int unbounded_push( stacktype *s, int value) {
| unbounded_stack type *us = (void *)s;
| unbounded_subst acktype *cs = us->current_stac k;
| unbounded_subst acktype *fs;
| if (cs == 0 || push(cs->substack, value) == -1) {
| fs = us->free_stack;
| if (fs == 0) {
| if ((fs = create_unbounde d_substack()) == 0) return -1;
| } else us->free_stack = 0;
| fs->link = cs;
| cs = us->current_stac k = fs;
| return push(cs->substack, value);
| }
| return 0;
| }
|
| static int unbounded_pop(s tacktype *s, int *value) {
| unbounded_stack type *us = (void *)s;
| unbounded_subst acktype *cs = us->current_stac k;
| unbounded_subst acktype *fs;
| if (cs == 0) return -1;
| if (pop(cs->substack, value) == -1) {
| fs = cs;
| cs = us->current_stac k = cs->link;
| if (us->free_stack == 0) us->free_stack = fs;
| else destroy_unbound ed_substack(fs) ;
| return pop(cs->substack, value);
| }
| return 0;
| }
|
| static void unbounded_popal l(stacktype *s) {
| unbounded_stack type *us = (void *)s;
| unbounded_subst acktype *cs = us->current_stac k;
| unbounded_subst acktype *fs = us->free_stack;
| if (cs == 0) return;
| if (fs == 0) {
| fs = us->free_stack = cs;
| cs = us->current_stac k = cs->link;
| fs->link = 0;
| popall(fs->substack);
| }
| while (cs != 0) {
| cs = cs->link;
| destroy_unbound ed_substack(us->current_stack) ;
| us->current_stac k = cs;
| }
| }
|
| static void destroy_unbound ed_stack(stackt ype *s) {
| unbounded_stack type *us = (void *)s;
| unbounded_popal l(s);
| if (us->free_stack) destroy_unbound ed_substack(us->free_stack);
| free(s);
| }
|
| static const stacktype unbounded_stack _interface = {
| unbounded_push,
| unbounded_pop,
| unbounded_popal l,
| destroy_unbound ed_stack,
| };
|
| stacktype *create_unbound ed_stack(void) {
| unbounded_stack type *us;
| us = malloc(sizeof(u nbounded_stackt ype));
| if (us == 0) return 0;
| us->interface = unbounded_stack _interface;
| us->current_stac k = 0;
| us->free_stack = 0;
| return &us->interface;
| }
+---

The final example shows an extensible polymorphic interface in C. The
interface is exposed in an object that can be inherited. The example
leverages the inheritance to provide multiple implementations of the
interface. Code utilizing the interface can be simultaneously reused to
manipulate either a bounded or unbounded stack. Code can furthermore
inherit the interface and provide their own implementations .

This is of course only an example, and the techniques applied here is
arguably overkill for such a simple data structure. The simplicity,
however, allows the techniques to be illustrated in a relatively
straight forward and compact manner. These techniques here are nothing
new to the experienced software professional. They will be found in OS
kernel code, I/O interface APIs, protocol stacks, GUI APIs, and many
other places.

-- James
Nov 13 '05 #15
Or you can study the lightweight C++ preprocessor, which takes as input
a language that looks like C++ and produces good old C.


AHEM... although I think it's really interesting and I've successfully
used it, given something like

my_var_ptr = new myclass(param);

you get

my_var_ptr = (
{ struct myclass*InTeRnA l_y = (struct myclass *)malloc(sizeof (struct
myclass));
myclass_ctor(In TeRnAl_y, param);
InTeRnAl_y; } );

I think this should be instead

struct myclass *InTeRnAl_y = malloc(sizeof(s truct myclass));
my_var_ptr = InTeRnAl_y
myclass_ctor(In TeRnAl_y, param);

Not to mention some gcc extensions like

static void GlObALcOnStRuCt Or ( )
{
}
static void (*_Counter_cppA sCiiArT)(void) __attribute__ ((unused,__sect ion__
(".ctors"))) = GlObALcOnStRuCt Or;

appended to every source "translated "...

Ah... and you can't compile the sources without gcc... (plus cygwin on
Windows..).

PS: Anyway I've supported it from the start ^^



Nov 13 '05 #16
Fronsac wrote:
I've been asked in a job interview how to make C code look like C++
code, and honestly I didn't know what to answer because I have never really
done a lot of C. Now, I've been searching around the web about web sites
that talk about this subject, but I've had no luck.

$ cat Point.h
#ifndef _Point_h
#define _Point_h 1

typedef struct {
/* representation */
double X;
double Y;
} Point;
/* functions */
double
xPoint(const Point *p);
double
yPoint(const Point *p);
/* constructors */
Point
createDefaultPo int(void);
Point
createExplicitP oint(double x, double y);
/* destructor */
void
destroyPoint(Po int* p);

#endif /* _Point_h */

$ cat Point.c
/* gcc -I. -O2 -c Point.c
*/
#include<Point. h>

/* functions */
double
xPoint(const Point *p) {
return p->X; }
double
yPoint(const Point *p) {
return p->Y; }
/* constructors */
Point
createDefaultPo int(void) {
Point p;
p.X = 0.0;
p.Y = 0.0;
return p; }
Point
createExplicitP oint(double x, double y) {
Point p;
p.X = x;
p.Y = y;
return p;
}
/* destructor */
void
destroyPoint(Po int* p) { }

$ cat Color.h
#ifndef _Color_h
#define _Color_h 1
typedef struct {
unsigned char R; /* red */
unsigned char G; /* green */
unsigned char B; /* blue */
} Color;
/* functions */
unsigned int
redColor(const Color *c);
unsigned int
greenColor(cons t Color *c);
unsigned int
blueColor(const Color *c);
/* constructors */
Color
createDefaultCo lor(void);
Color
createExplicitC olor(
unsigned int r,
unsigned int g,
unsigned int b);
/* destructor */
void
destroyColor(Co lor *c);

#endif /* _Color_h */

$ cat Color.c
/* gcc -I. -O2 -c Color.c
*/
#include<Color. h>

/* functions */
unsigned int
redColor(const Color *c) {
return c->R; }
unsigned int
greenColor(cons t Color *c) {
return c->G; }
unsigned int
blueColor(const Color *c) {
return c->B; }
/* constructors */
Color
createDefaultCo lor(void) {
Color c;
c.R = 0;
c.G = 0;
c.B = 0;
return c; }
Color
createExplicitC olor(
unsigned int r,
unsigned int g,
unsigned int b) {
Color c;
c.R = r;
c.G = g;
c.B = b;
return c; }
/* destructor */
void
destroyColor(Co lor *c) { }

$ cat Shape.h
#ifndef _Shape_h
#define _Shape_h 1

#include<Point. h>
#include<Color. h>

typedef void* virtual_t;
typedef struct {
Point P; /* first public base class */
Color C; /* second public base class */
virtual_t* V; /* virtual function table */
} Shape;
/* functions */
Point*
pointShape(Shap e* s);
Color*
colorShape(Shap e* s);
void
drawShape(const Shape *s);
void
drawGeneralShap e(const Shape *s);
double
areaShape(const Shape *s);
double
areaGeneralShap e(const Shape *s);
/* constructors */
Shape
createDefaultSh ape(void);
Shape
createExplicitS hape(
const Point *p,
const Color *c);
/* destructor */
void
destroyShape(Sh ape *s);

#endif /* _Shape_h */

$ cat Shape.c
/* gcc -I. -O2 -c Shape.c
*/
#include<stdio. h>
#include<Shape. h>

typedef void (*drawShape_t)( const Shape *);
typedef double (*areaShape_t)( const Shape *);
/* functions */
Point*
pointShape(Shap e* s) {
return &(s->P); }
Color*
colorShape(Shap e* s) {
return &(s->C); }
void
drawGeneralShap e(const Shape *s) {
fprintf(stderr, "drawShape(cons t Shape *s)\n");
fflush(stderr); }
double
areaGeneralShap e(const Shape *s) {
fprintf(stderr, "areaShape(cons t Shape *s)\n");
fflush(stderr);
return 0.0; }
static virtual_t
vtableShape[] = {(virtual_t)dra wGeneralShape,
(virtual_t)area GeneralShape};
void
drawShape(const Shape *s) {
((drawShape_t)( s->V[0]))(s); }
double
areaShape(const Shape *s) {
return ((areaShape_t)( s->V[1]))(s); }
/* constructors */
Shape
createDefaultSh ape(void) {
Shape S;
S.P = createDefaultPo int();
S.C = createDefaultCo lor();
S.V = vtableShape;
return S; }
Shape
createExplicitS hape(
const Point *p,
const Color *c) {
Shape S;
S.P = *p;
S.C = *c;
S.V = vtableShape;
return S; }
/* destructor */
void
destroyShape(Sh ape *s) {
destroyColor(co lorShape(s));
destroyPoint(po intShape(s));
}

$ cat Circle.h
#ifndef _Circle_h
#define _Circle_h 1

#include<Shape. h>

typedef struct {
Shape S; /* public base class */
double R; /* radius */
} Circle;
/* functions */
Shape*
shapeCircle(Cir cle* c);
double
radiusCircle(co nst Circle* c);
void
drawCircle(cons t Circle *c);
double
areaCircle(cons t Circle *c);
/* constructors */
Circle
createDefaultCi rcle(void);
Circle
createExplicitC ircle(const Shape *s, double r);
/* destructor */
void
destroyCircle(C ircle *c);

#endif /* _Circle_h */

$ cat Circle.c
/* gcc -I. -O2 -c Circle.c
*/
#include<math.h >
#include<stdio. h>
#include<Circle .h>

typedef void (*drawCircle_t) (const Circle *);
typedef double (*areaCircle_t) (const Circle *);
/* functions */
Shape*
shapeCircle(Cir cle* c) {
return &(c->S); }
double
radiusCircle(co nst Circle* c) {
return c->R; }
void
drawCircle(cons t Circle *c) {
fprintf(stderr, "drawCircle(con st Circle *c)\n");
fflush(stderr); }
double
areaCircle(cons t Circle *c) {
const
double pi = 3.1415926535897 9323846;
double r = radiusCircle(c) ;
fprintf(stderr, "areaCircle(con st Circle *c)\n");
fflush(stderr);
return pi*r*r; }
static virtual_t
vtableCircle[] = {(virtual_t)dra wCircle,
(virtual_t)area Circle};
/* constructors */
Circle
createDefaultCi rcle(void) {
Circle C;
C.S = createDefaultSh ape();
C.R = 0.0;
C.S.V = vtableCircle;
return C; }
Circle
createExplicitC ircle(const Shape *s, double r) {
Circle C;
C.S = *s;
C.R = r;
C.S.V = vtableCircle;
return C; }
/* destructor */
void
destroyCircle(C ircle *c) {
destroyShape(sh apeCircle(c));
}

$ cat main.c
/* gcc -I. -O2 -o main main.c Circle.o Shape.o Color.o Point.o
*/
#include<stdio. h>
#include<Circle .h>

int
main(int argc, char* argv[]) {
Shape s = createDefaultSh ape();
Circle c = createExplicitC ircle(&s, 2.0);
drawShape((Shap e*)(&c));
fprintf(stdout, "%g = radius\t %g = area\n",
radiusCircle(&c ), areaShape((Shap e*)(&c)));
return 0;
}

$ cat Makefile
CC=gcc
DEFINES=
INCLUDE=-I.
OPTIONS=-O2
LIBRARY=
OBJECTS=Point.o Color.o Shape.o Circle.o
SOURCES=Point.c Color.c Shape.c Circle.c
HEADERS=Point.h Color.h Shape.h Circle.h
library=
COMPILE=$(CC) $(DEFINES) $(INCLUDE) $(LIBRARY) $(OPTIONS)

main: $(HEADERS) $(OBJECTS) main.c
$(COMPILE) -o main main.c $(OBJECTS) $(library)

Point.o: Point.h Point.c
$(COMPILE) -c Point.c

Color.o: Color.h Color.c
$(COMPILE) -c Color.c

Shape.o: Shape.h Shape.c
$(COMPILE) -c Shape.c

Circle.o: Circle.h Circle.c
$(COMPILE) -c Circle.c

clean:
rm $(OBJECTS) main

Nov 13 '05 #17

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

Similar topics

17
3383
by: Gabriel Mejía | last post by:
Services or applications using ActiveX Data Objects (ADO) 2.0 or greater may intermittently return empty recordsets on queries that should be returning valid results. At the time the problem occurs, the same queries successfully return the expected data when run from non-ADO sources, such as from ISQL in Microsoft SQL Server. This problem predominantly occurs on multi-processor computers but has also been known to occur on single-processor...
13
2938
by: python | last post by:
hello and thanks for reading this, i have been a dos/windows user using some form of the basic language for 30 years now. i own and run a small programming company and there is one feature that keeps me in the windows/basic world. while i will agree that it has not evolved well, it does have one awesome feature that i have yet to see replicated in any linux product that i know about so far. i am a long time windows user and have had...
10
2044
by: Alejandro Castañaza | last post by:
Hi. I'm writing a program, and I need to send confidential data through the network, so I decided to use encryption, using the System.Security.Cryptography namespace. I'm using the sockets for the network communications, and the program first does a key exchange, with the asymetric cipher classes, to get a new key for the symmetric cipher. My problem is, that although I have checked that the two points get to the same key and...
0
4670
by: Daniel Thune, MCSE | last post by:
I am having a problem with formatting a SOAP Header in a .Net client. The client calls a Java Axis 1.1 based web service. In order to authenticate the caller, the web service call is intercepted by another web service that validates a security token in the header. I have pasted my current SOAP message that my code sends as captured from a trace function that I added. Below that is a sample SOAP message that the developer of the web...
3
1350
by: RSH | last post by:
I am slowly getting the hang of objects and creating my own. I was given some help in assigning an object to a ComboBox collection. I have been looking at it and I get the concept which is very powerful but I'm having a bit of a problem conceptually. I was hoping someone might be able to shed some light on creating this object and assigning it in the manner. Also how would I reference this object by name after it is created in this...
9
1220
by: seberino | last post by:
Is there any advantage to a language having a nice mathematically compact grammar like LISP does? (or at least used to?) Many have admired the mathematically simple grammar of LISP in which much of the language is built up from conses IIRC. Python's grammar seems complicated by comparison. Is this anything to worry about?
1
1440
by: KShapiro | last post by:
Hi All, I am trying to assist my wife, by making a simple menu system for the website. The web page is a .php4 file and does an include of the navigation file. Before it includes that file at the top I have the following line of code to include my .js file. <script src="scripts/SideNav.js" language="JavaScript" type="text/javascript"></script> that is inside the <head> tag. It used to work fine with a more hard coded version of...
5
3499
by: tkondal | last post by:
Hi all. I just started looking at Python's ctypes lib and I am having trouble using it for a function. For starters, here's my Python code: from ctypes import*; myStringDLL= cdll.LoadLibrary("myStringDLL.dll");
1
1512
by: jeddiki | last post by:
Hi, I am having difficulty seeing why my divs will not swap places :confused: I want to swap the positions of the "Hot News" and the "Todays Bonuese" sections. Here is how they look now: http://www.expert-world.com/im/images/trash1.jpg
0
9566
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10153
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
10007
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...
1
9946
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9832
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6646
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5272
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...
1
3921
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3530
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.