473,779 Members | 2,016 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

K&R C and strings

I wonder if anyone has time to write a small example program based on
this data or to critique my own effort?

A file called Realm List.html contains the following data:
Bladefist-Horde
Nordrassil-Horde
Draenor-Alliance
Nordrassil-Alliance
Nordrassil-Neutral
Draenor-Horde
Moonglade-Horde
Shadowmoon-Horde
Moonglade-Alliance

I need an algorithm that takes from this list the names of Realms that
we have both Alliance and Horde data for and to list them in
alphabetical order. My desired format of this list will be:
Draenor-Alliance
Draenor-Horde
Moonglade-Alliance
Moonglade-Horde
Nordrassil-Alliance
Nordrassil-Horde

I'm committed to using ANSI C with the K&R book as my guide. It says a
string is an array of chars.

Right now I can open the file, I can use strtok to split each line but
I can't work out how to create an array of these strings?

FILE *realmList;
if((realmList=f open("Realm List.html","w+" )) == NULL)
{
printf("Couldn' t open \"Realm List.html\" for output\n");
return 1;
}

/*
List Realms and count of each
*/
char strLine[244];

while (fgets(strLine, 244, realmList))
{

char *tmp = NULL;
char token[] = "-";
tmp = strtok(strLine, token);

printf("%s\n", tmp);
/* stuck at this point */
}

Sep 24 '06 #1
19 3115
pkirk25 schrieb:
I wonder if anyone has time to write a small example program based on
this data or to critique my own effort?

A file called Realm List.html contains the following data:
Bladefist-Horde
Nordrassil-Horde
Draenor-Alliance
Nordrassil-Alliance
Nordrassil-Neutral
Draenor-Horde
Moonglade-Horde
Shadowmoon-Horde
Moonglade-Alliance

I need an algorithm that takes from this list the names of Realms that
we have both Alliance and Horde data for and to list them in
alphabetical order. My desired format of this list will be:
Draenor-Alliance
Draenor-Horde
Moonglade-Alliance
Moonglade-Horde
Nordrassil-Alliance
Nordrassil-Horde

I'm committed to using ANSI C
Okay. Note that this may not be the "best" or "easiest" language
for this task.
with the K&R book as my guide. It says a
string is an array of chars.
Ah, read more closely. An array of char only contains a string if
it contains at least one '\0' character, i.e.
char a[] = {'h', 'e', 'l', 'l', 'o'};
is not a string while
char a[] = {'h', 'e', 'l', 'l', '\0'};
or, equivalently,
char a[] = "hell";
is.
char a[] = {'h', '\0', 'l', 'l', '\0'};
also contains a string ("h");
Right now I can open the file, I can use strtok to split each line but
I can't work out how to create an array of these strings?

FILE *realmList;
if((realmList=f open("Realm List.html","w+" )) == NULL)
Note: This effectively deletes the contents of "Realm List.html".
You probably want "r+" or just "r" as you stated that you want to
_read_ your input data from the file.
{
printf("Couldn' t open \"Realm List.html\" for output\n");
return 1;
}

/*
List Realms and count of each
*/
char strLine[244];

while (fgets(strLine, 244, realmList))
Note that this approach has problems:
- fgets() does not necessarily give you the whole line but only
in this case up to 244-2 non-'\n' characters.
- You still need some "new" storage to put the read string for
a while.
Have a look at C.B. Falconer's fggets() which gives you full lines
and allocates the storage for them.
http://cbfalconer.home.att.net/download/
{

char *tmp = NULL;
char token[] = "-";
tmp = strtok(strLine, token);
This effectively destroys your input, i.e. you cannot sort according
to the "-Alliance" or "-Horde" suffix.
You could alternately find the first '-' with strchr() and store that
position.
printf("%s\n", tmp);
If you just have the position from strchr(), you can use the
precision field to print only a certain number of characters from
a string.
printf(".*s\n", numChars, strLine);

You want an array of variably sized strings, so, having an
array of pointers to the first characters of strings is a better
solution.
Moreover, you do not know the size of the array beforehand, so
using allocated storage may be the best solution.
Before the loop:
size_t size = YOUR_START_SIZE ;
size_t count = 0;
char **Strings;
char *strLine;
int ErrOrEOF;
....

Strings = malloc((size+1) * sizeof *Strings);
if (NULL == Strings) {
/* your error handling here */
}

The loop:

while (!(ErrOrEOF = fggets(&strLine , realmList))) {
if (count >= size) {
char **tmp = realloc(Strings , (2*size+1) * sizeof *Strings);
if (NULL == tmp) {
/* your error handling here */
}
Strings = tmp;
size *= 2;
}
Strings[count++] = strLine;
}
if (EOF != ErrOrEOF) {
/* An error occurred */
}

The above is not tested.
As soon as you got it to compile and work, you have "count" strings.
You can sort them using qsort().

Cheers
Michael
--
E-Mail: Mine is an /at/ gmx /dot/ de address.
Sep 24 '06 #2
On 24 Sep 2006 11:43:21 -0700, "pkirk25" <pa*****@kirks. netwrote:
>I wonder if anyone has time to write a small example program based on
this data or to critique my own effort?
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#ifndef strdup
char *strdup(const char *s) {
char *r;
return (r=calloc(strle n(s)+1,1))?strc py(r,s):0;
}
#endif

char *read_str(char *s, int max) {
char *r=fgets(s, max, stdin);
if (r) {
int len=strlen(s);
if (len && s[len-1]=='\n')
s[len-1]='\0';
}
return r;
}

typedef struct node_tag {
char *name;
struct node_tag *next;
} node_t, *pnode_t;

pnode_t node_new(const char *n) {
pnode_t i=malloc(sizeof *i);
if (i) {
i->next=0;
i->name=strdup(n) ;
}
return i;
}

void node_free(pnode _t self) {
if (self) {
if (self->name) free(self->name);
free(self);
}
}

void list_print(pnod e_t head) {
if (head) {
puts(head->name);
list_print(head->next);
}
else printf("(end of the list)\n");
}

void list_free(pnode _t head) {
if (head) {
list_free(head->next);
node_free(head) ;
}
}

void list_insert(pno de_t *phead, pnode_t new_node) {
if (!*phead)
*phead=new_node ;
else
if (strcmp(new_nod e->name, (*phead)->name)<=0) {
new_node->next=*phead;
*phead=new_node ;
}
else
list_insert(&(* phead)->next, new_node);
}

int main() {
pnode_t head=0;

list_insert(&he ad, node_new("Blade fist-Horde"));
list_insert(&he ad, node_new("Nordr assil-Horde"));
list_insert(&he ad, node_new("Draen or-Alliance"));
list_insert(&he ad, node_new("Nordr assil-Alliance"));
list_insert(&he ad, node_new("Nordr assil-Neutral"));
list_insert(&he ad, node_new("Draen or-Horde"));
list_insert(&he ad, node_new("Moong lade-Horde"));
list_insert(&he ad, node_new("Shado wmoon-Horde"));
list_insert(&he ad, node_new("Moong lade-Alliance"));

list_print(head );
list_free(head) ;

return 0;
}
Sep 24 '06 #3
Two great answers.

Thanks - if I can make it all fit together I may well become the first
World of Warcraft gold millionaire!

Sep 24 '06 #4
On Mon, 25 Sep 2006 00:18:20 +0200, Andrea Laforgia
<a.********@and realaforgia.it. invalidwrote:
>On 24 Sep 2006 11:43:21 -0700, "pkirk25" <pa*****@kirks. netwrote:
>>I wonder if anyone has time to write a small example program based on
this data or to critique my own effort?

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#ifndef strdup
This will not prevent this code from compiling when strdup is declared
in one of these headers as something other than a macro. Since it is
not a standard function or standard macro, it should not be in any of
these headers anyway.
>char *strdup(const char *s) {
Function names beginning with str and a lower case letter are
reserved.
char *r;
return (r=calloc(strle n(s)+1,1))?strc py(r,s):0;
Is there a reason you chose to use calloc and spend the cycles setting
each byte to '\0' when you immediately use strcpy to initialize every
byte anyway?
>}
#endif

char *read_str(char *s, int max) {
char *r=fgets(s, max, stdin);
if (r) {
int len=strlen(s);
if (len && s[len-1]=='\n')
If r is not NULL, can len ever by zero?
s[len-1]='\0';
}
return r;
}

typedef struct node_tag {
char *name;
struct node_tag *next;
} node_t, *pnode_t;

pnode_t node_new(const char *n) {
pnode_t i=malloc(sizeof *i);
if (i) {
i->next=0;
i->name=strdup(n) ;
}
return i;
}

void node_free(pnode _t self) {
if (self) {
if (self->name) free(self->name);
free(self);
}
}

void list_print(pnod e_t head) {
if (head) {
puts(head->name);
list_print(head->next);
Recursion is unnecessarily expensive here. A simple while loop will
work.
}
else printf("(end of the list)\n");
}

void list_free(pnode _t head) {
if (head) {
list_free(head->next);
node_free(head) ;
}
}

void list_insert(pno de_t *phead, pnode_t new_node) {
if (!*phead)
*phead=new_node ;
else
if (strcmp(new_nod e->name, (*phead)->name)<=0) {
new_node->next=*phead;
*phead=new_node ;
}
else
list_insert(&(* phead)->next, new_node);
Recursion can also be avoided here.
>}

int main() {
pnode_t head=0;

list_insert(&he ad, node_new("Blade fist-Horde"));
list_insert(&he ad, node_new("Nordr assil-Horde"));
list_insert(&he ad, node_new("Draen or-Alliance"));
list_insert(&he ad, node_new("Nordr assil-Alliance"));
list_insert(&he ad, node_new("Nordr assil-Neutral"));
list_insert(&he ad, node_new("Draen or-Horde"));
list_insert(&he ad, node_new("Moong lade-Horde"));
list_insert(&he ad, node_new("Shado wmoon-Horde"));
list_insert(&he ad, node_new("Moong lade-Alliance"));

list_print(head );
list_free(head) ;

return 0;
}

Remove del for email
Sep 25 '06 #5
On Sun, 24 Sep 2006 17:18:12 -0700, Barry Schwarz <sc******@doezl .net>
wrote:
>Is there a reason you chose to use calloc and spend the cycles setting
each byte to '\0' when you immediately use strcpy to initialize every
byte anyway?
Well it comes from my implementation of strndup() which doesn't
necessarily append a '\0' to the new string. However, you're right:
in this case a simple malloc() is enough.
> int len=strlen(s);
if (len && s[len-1]=='\n')

If r is not NULL, can len ever by zero?
Of course: strlen("").
>Recursion is unnecessarily expensive here. A simple while loop will
work.
I know, but I like recursion really much ("De gustibus non disputandum
est" ;-), I feel comfortable with it and, in order to write code
quickly, I use it. The OP can transform that recursion into a plain
iteration. It is just a sample code.
Sep 25 '06 #6
pkirk25 wrote:
I wonder if anyone has time to write a small example program based on
this data or to critique my own effort?

A file called Realm List.html contains the following data:
Bladefist-Horde
Nordrassil-Horde
Draenor-Alliance
Nordrassil-Alliance
Nordrassil-Neutral
Draenor-Horde
Moonglade-Horde
Shadowmoon-Horde
Moonglade-Alliance
This is not a typical format for a .html file. It looks like straight
text.
I need an algorithm that takes from this list the names of Realms that
we have both Alliance and Horde data for and to list them in
alphabetical order. My desired format of this list will be:
Draenor-Alliance
Draenor-Horde
Moonglade-Alliance
Moonglade-Horde
Nordrassil-Alliance
Nordrassil-Horde
So you want to sort the lines of text alphabetically right?
I'm committed to using ANSI C with the K&R book as my guide. It says a
string is an array of chars.
In straight C strings are just a rats nest of pain and suffering. C
handles string within arrays of chars, however, it doesn't do a lot to
help you manage the array of chars to begin with. I.e., the problems
of memory management are basically yours to solve.
Right now I can open the file, I can use strtok to split each line but
I can't work out how to create an array of these strings?
If you were looking at a language like Perl or Python this kind of
thing is just 4 or 5 lines of code. What you want is some way to do
something similar in C.

By using more advanced strings (i.e., not the crap that the language
comes with), this is possible in the C language. I have written a
string library called "The Better String Library" which is perfectly
suited for this. Using this library leads you to:

#include <stdio.h>
#include <stdlib.h>
#include "bstrlib.h"

/* The string comparison function for qsort */
static int lineCmp (const bstring * s0, const bstring * s1) {
return bstrcmp (*s0, *s1); /* Deal with the extra indirection */
}

int main () {
FILE * fp = fopen ("Realm List.html", "r");
if (fp) {
bstring b = bread ((bNread) fread, fp); /* Read the whole input */
struct bstrList * sl = bsplit (b, '\n'); /* Build the array of
lines */
fclose (fp);
if (sl) {
qsort (sl->entry, sl->qty, sizeof (bstring), lineCmp); /* Sort
the lines */
fp = fopen ("Realm List.html", "w"); /* Overwrite the input file
*/
if (fp) {
int i;
for (i=0; i < sl->qty; i++) { /* Write each line */
fprintf (fp, "%s\n", (char *) sl->entry[i]->data);
}
fclose (fp); /* Commit the file */
}
bstrListDestroy (sl); /* Clean up string list */
}
bdestroy (b); /* Clean up input string */
}
return 0;
}

Not quite as compact as you can get from other modern languages, but a
whole hell of a lot better than what you can achieve in straight C.
Notice how there are no mysterious constants on array declarations that
usually either over-commits memory or under allocates it. You can
download the library here:

http://bstring.sf.net/
FILE *realmList;
if((realmList=f open("Realm List.html","w+" )) == NULL)
"w+" mode means append to current file in write mode. So you will end
up just increasing the size of the input file, rather than overwriting
it with its sorted contents.
{
printf("Couldn' t open \"Realm List.html\" for output\n");
return 1;
}

/*
List Realms and count of each
*/

char strLine[244];
Where does the number 244 come from? (Hint: you don't know, and
neither do I, nor does K&R nor anyone else.)
while (fgets(strLine, 244, realmList))
{

char *tmp = NULL;
char token[] = "-";
tmp = strtok(strLine, token);
This tokenization is not useful. Lines are split by '\n', however this
is already taken care of by the fgets(). With lexical sorting, the
hyphened format of your input data is intrinsically taken into account.

Your concern here is to *store* the line somewhere, not parse it. The
problem is that as you run through the loop, you are going to overwrite
the contents of strLine each time -- i.e., you can only hold storage
for one line at a time. What you need to is to create new storage for
each line, and retain a copy of each line in that storage. You then
have the additional problem that you need to hold the entire collection
of allocated lines in such a way as to come back and be able to sort
them.

C has a function for sorting called "qsort" but that requires that your
lines be stuffed in an array. Perhaps we can have some more "magical
numbers":

char * lineArray[23726]; /* I literally mashed the keyboard for that
number */

then somewhere along that way we could use a counter to store the
results of each read -- but we still need storage for each line. So we
learn about "malloc" and we can try to cobble together a solution:

char strLine[244], * lineArray[23726];
int counter = 0;

if (NULL != (realmList = fopen ("Realm List.html", "r"))) {
while (fgets(strLine, 244, realmList)) {
char * storage = (char *) malloc (1+strlen (strLine));
if (storage) {
strcpy (storage, strLine);
lineArray[counter] = storage; /* This may overflow */
counter++;
} else {
printf ("We ran out of memory\n");
return 1;
}
}
fclose (realmList);
qsort (lineArray, counter, sizeof (char *), pstrcmp);

/* Write the file ... */

/* Free the memory (if you want to be a good citizen) */
}

And you are going to have to make a pstrcmp() function which takes a
pair of char **'s and calls strcmp on the once dereferenced parameters.
The problem with these kinds of typical C solutions is that you are
limited to lines of length at most 243 (before truncation and a
resulting input corruption happens), and you can hold at most 23726
lines (before the program overflows and causes undefined behaviour).
So all that work, and still the solution is just not satisfactory. (We
could avoid the overflow by putting a test on the value of counter as
it is incremented and just break out of the loop -- but this just leads
to another truncation condition.)

The solution that uses Bstrlib given above has no such limitation --
you are only limited by available memory. The Bstrlib version will
never give you erroneous results -- errors (in Bstrlib running out of
memory is the only real error) are deterministical ly detectable and you
can abort the whole process as the errors are detected, or use some
other strategy to proceed if you like.

--
Paul Hsieh
http://www.pobox.com/~qed/
http://bstring.sf.net/

Sep 26 '06 #7
we******@gmail. com said:
pkirk25 wrote:
<snip>
>I need an algorithm that takes from this list the names of Realms that
we have both Alliance and Horde data for and to list them in
alphabetical order. My desired format of this list will be:
Draenor-Alliance
Draenor-Horde
Moonglade-Alliance
Moonglade-Horde
Nordrassil-Alliance
Nordrassil-Horde

So you want to sort the lines of text alphabetically right?
>I'm committed to using ANSI C with the K&R book as my guide. It says a
string is an array of chars.
Close. It's a sequence of adjacent characters (typically stored in an array,
yes) that is terminated by the first null character in that sequence.
In straight C strings are just a rats nest of pain and suffering.
For websnarf, this may well be true. Other people seem to manage, though.

<snip>
By using more advanced strings (i.e., not the crap that the language
comes with),
Not everyone shares websnarf's opinion.
this is possible in the C language.
It's possible using the ordinary C string library too.
I have written a
string library called "The Better String Library" which is perfectly
suited for this.
Of the two URLs in your sig, one failed to load at all, and the other
presented a bizarre set of cartoon drawings, none of which had any obvious
relation to any kind of string libraries. Perhaps you would be so kind as
to provide a link, so that we can see whether your library meets the OP's
requirement of ANSI C.
You can
download the library here:

http://bstring.sf.net/
Yeah, I tried that one.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
Sep 26 '06 #8
Richard Heathfield wrote:
we******@gmail. com said:
pkirk25 wrote:
<snip>
I need an algorithm that takes from this list the names of Realms that
we have both Alliance and Horde data for and to list them in
alphabetical order. My desired format of this list will be:
Draenor-Alliance
Draenor-Horde
Moonglade-Alliance
Moonglade-Horde
Nordrassil-Alliance
Nordrassil-Horde
So you want to sort the lines of text alphabetically right?
I'm committed to using ANSI C with the K&R book as my guide. It says a
string is an array of chars.

Close. It's a sequence of adjacent characters (typically stored in an array,
yes) that is terminated by the first null character in that sequence.
In straight C strings are just a rats nest of pain and suffering.

For websnarf, this may well be true. Other people seem to manage, though.
Yes, you can see evidence of this through CERT's advisory list or even
the lists from Secunia. So others "manage" alright -- they *manage* to
write code that doesn't work. I have higher standards for *managing*
so, yes its true for me.
<snip>
By using more advanced strings (i.e., not the crap that the language
comes with),

Not everyone shares websnarf's opinion.
As is in full evidenced by the number of bug-free complete solutions
given here using pure C. *Sound of crickets*.
this is possible in the C language.

It's possible using the ordinary C string library too.
We know its *possible*. But the fact that nobody has posted such a
thing is probably evidence of something. Even after Andrea Laforgia's
tour de force effort, all he's done is read and print the list of
strings. He's missing the sort part. I mean, link lists are awesome
and all, but how is he planning on sorting it? Does he have a linked
list based merge sort handy?

I mean I have better things to do than to painstakingly debug some code
that I just intend to post to c.l.c. So what motivated me to write up
a whole Bstrlib solution? Obviously, its because its completely
trivial to do using Bstrlib -- its just not much of an effort at all.
I have written a
string library called "The Better String Library" which is perfectly
suited for this.

Of the two URLs in your sig, one failed to load at all, and the other
presented a bizarre set of cartoon drawings, none of which had any obvious
relation to any kind of string libraries.
I am not in charge of the www or your access to it. I can get the
bstring.sf.net without difficulty. You can try bstring.sourcef orge.net
which is the same thing.
[...] Perhaps you would be so kind as
to provide a link, so that we can see whether your library meets the OP's
requirement of ANSI C.
Well it does, and I've provided the link. Perhaps you should call
customer support at your ISP.

--
Paul Hsieh
http://www.pobox.com/~qed/
http://bstring.sf.net/

Sep 26 '06 #9
we******@gmail. com said:
Richard Heathfield wrote:
>we******@gmail. com said:
In straight C strings are just a rats nest of pain and suffering.

For websnarf, this may well be true. Other people seem to manage, though.

Yes, you can see evidence of this through CERT's advisory list or even
the lists from Secunia. So others "manage" alright -- they *manage* to
write code that doesn't work.
Um, so what? The existence of people who cannot understand C does not imply
the non-existence of people who can.

<snip>
>It's possible using the ordinary C string library too.

We know its *possible*. But the fact that nobody has posted such a
thing is probably evidence of something.
It could just be evidence of DYOH.

<snip>
I have written a
string library called "The Better String Library" which is perfectly
suited for this.

Of the two URLs in your sig, one failed to load at all, and the other
presented a bizarre set of cartoon drawings, none of which had any
obvious relation to any kind of string libraries.

I am not in charge of the www or your access to it. I can get the
bstring.sf.net without difficulty. You can try bstring.sourcef orge.net
which is the same thing.
That worked. The compilation didn't, though. You're a bit cavalier with
constness.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
Sep 26 '06 #10

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

Similar topics

5
6487
by: Edward K. Ream | last post by:
Am I reading pep 277 correctly? On Windows NT/XP, should filenames always be converted to Unicode using the mbcs encoding? For example, myFile = unicode(__file__, "mbcs", "strict") This seems to work, and I'm wondering whether there are any other details to consider. My experiments with Idle for Python 2.2 indicate that os.path.join doesn't work as I expect when one of the args is a Unicode string. Everything
2
20534
by: Eric Osman | last post by:
Hi, I'm looking for a javascript function that will convert input such as this: <CLUB Code=" into this: &lt;CLUB Code=&quot;
4
6072
by: webdev | last post by:
lo all, some of the questions i'll ask below have most certainly been discussed already, i just hope someone's kind enough to answer them again to help me out.. so i started a python 2.3 script that grabs some web pages from the web, regex parse the data and stores it localy to xml file for further use.. at first i had no problem using python minidom and everything concerning
2
3577
by: Thierry Lam | last post by:
Let's say I have the following xml tag: <para role="source">a & b</para> Currently, an xml parser will treat & as a special character. Does anyone know the special characters to use around the ampersand so that the xml parser can treat "a & b" as a whole value? Thanks Thierry
1
3981
by: st | last post by:
Hi, I'm using xmlDocument.Save(xmlTextWriter) to create an Excel-readable file. All works well, except where I've replaced the carriage return chars in the .innertext to XML-compliant " "; It gets changed to "&amp;#10" and doesn't render new lines in the Excel sheet. Can anyone help? Many thanks,
7
1915
by: theBestFriend | last post by:
If I type in the vualue && from the standard input and store it into myInputString variable, I expected that expression if(myInputString == "&&") will evaluate to true, but it doesn't. Can you please explain why and what do I need to change to make it evaluate to true. I want to treat && as character string, not as a special characters but don't know how. When I type in >= or <=, both expressions if(myInputString == ">=") and...
16
1684
by: TTroy | last post by:
I FOUND MAJOR ERRORS in K&R2 (making it almost useless for the herein mentioned topics). K&R2 Section 5.9 Pointers vs. Multidimension Arrays starts of like this... "Newcomers to C are somtimes confused about the difference between a two-dimensional array and an array of pointers..." then continues to explain int *b; to be...
23
2974
by: arnuld | last post by:
i was doing exercise 4.3.1 - 4.29 of "C++ Primer 4/e" where authors, with "run-time shown", claim that C++ Library strings are faster than C-style character strings. i wrote the same programme in C & hence found that claim of the authors is *partial*. If we use C-style strings in C++ instead of Library String class, then they are slow but if write the same programme in C then C strings are "faster" than both C++ Library strings & C-style...
0
9636
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
10306
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
10138
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
10074
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
9930
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
5373
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
5503
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4037
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
3
2869
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.