473,803 Members | 3,619 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

getchar and character arrays

Why I can not begin my subscript of character arrrays with 0.
In this program I can not do :

do
{
na[i]=getchar();
i++;
na[i]=getchar();

} while (na[i]!='\n');
my program :
*-----------------------
void input(char *na)
{

int i=0;

printf ("Enter the name : ");
do
{
i++;

na[i]=getchar();

} while (na[i]!='\n');
}

Dec 7 '06
25 5452

CBFalconer wrote:
eh**********@gm ail.com wrote:
... snip ...

can I read '\n' using getchar() as I do in scanf ("\n") ?????

please suggested code :

void input (char *n)
////////////////////
{
int i=0;
printf ("\nInput :");
getchar()="\n";
do {
n[i]=getchar();
i++;
} while (n[i]!='\n');
}

void output (char *n)
////////////////////
{
int i=0;
printf ("\noutput :");
do {
printf ("%c" ,n[i]);
i++;
} while (n[i]!='\n');
}

Don't use // comments in usenet messages, they can easily be
wrapped and destroy the code. Also try to post complete compilable
programs, with proper indentation. Don't use tabs, because they
are often lost entirely.

'\n' is just another character. If you know that the input
contains an unread one you can flush it with a routine such as the
following:

int flushln(FILE *f) {
int ch;

while ((EOF != (ch = getc(f)) && ('\n' != ch)) continue;
return ch;
}

Calling this guarantees that any '\n' in the input has been
absorbed. It doesn't ensure that there was such to be absorbed.
Note that the input is stored in an int, so that EOF can be
detected. Also note that all input lines (on a buffered system,
which yours almost certainly is) terminate in a '\n'.

Now let us assume that you want to input lines not exceeding some
sort of maximum length, and are willing to discard any input longer
than that maximum. First you must define the maximum length
somewhere:

#define MAXLGH 80 /* just to pick a number out of the hat */

and somewhere you will have a buffer to hold the lines:

char buffer[MAXLGH];

now you want to call a routine to fill that buffer, and discard any
excess length:

void fillbuf(char *buf, int maxlgh); /* A prototype */

(which I haven't used - I combined it with something that prompts)

Putting things together you might end up with a program that looks
like:

#include <stdio.h>
#define MAXLGH 10

/* -------------- */

int flushln(FILE *f) {
int ch;

while ((EOF != (ch = getc(f))) && ('\n' != ch)) continue;
return ch;
}

/* -------------- */

int getinput(FILE *f, char *buf, int lgh, char *prompt) {
int i;
int ch;

fputs(prompt, stdout);
fflush(stdout);
i = 0;
while ((i < lgh) && (EOF != (ch = getc(f))) && ('\n' != ch)) {
/* study the above condition carefully,
especially the order of tests.
Note that with lgh 0 getc is always called */
buf[i++] = ch;
}
/* Now decide why the loop ended. */
if ('\n' != ch) ch = flushln(f);
/* This assumes that EOF is sticky. Don't worry about it */

/* Now we know that any final '\n' has been absorbed */

/* important - terminate the string */
buf[i] = '\0';
return ch;
}

/* -------------- */

int main(void) {

char buffer[MAXLGH + 1]; /* +1 allows for terminating '/0' */
char prompt[] = "Input: ";

while (EOF != getinput(stdin, buffer, MAXLGH, prompt)) {
fputs("Output: ", stdout); /* no appended '\n' */
puts(buffer); /* which appends a '\n' and forces output */
}
return 0; /* main always returns a value */
}

Note that the program terminates on receiving an EOF signal. How
this is done depends on your system. Under linux that will
probably be a CTL-d key. Under MSDOS or Windows that will probably
be a CTL-z key. Entered immediately after the "Input:" prompt.

Lines terminate on receiving a '\n', generated by the Enter key.
Storage terminates either on line termination or receiving MAXLGH
characters.

Aside: It would be well to add a 'static' in the headers of the
functions (other than main), but this won't affect anything until
you get into more complicated multi-file programs.

getchar() is just shorthand for getc(stdin). Routines are more
flexible when you can aim them at arbitrary files. Keep them as
simple as possible.

Don't use scanf for interactive input. It will always leave
confusion. When and if you do use it always check its return
value.

Carefully read the descriptions of each standard function I have
called. This includes getc, getchar, puts, fputs, fflush. Note
that they all do simple things.

--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home .att.net>
I appreciate your trail to give me a better code but still How can I
fix above code to make the loop like this :
{
...
na[i]=getchar();
+ii;
...
}

and not like this
{
...
+ii;
na[i]=getchar();
...
}

Thanks

Dec 16 '06 #21

eh**********@gm ail.com wrote:
CBFalconer wrote:
eh**********@gm ail.com wrote:
>
... snip ...
>
can I read '\n' using getchar() as I do in scanf ("\n") ?????
>
please suggested code :
>
void input (char *n)
////////////////////
{
int i=0;
printf ("\nInput :");
getchar()="\n";
do {
n[i]=getchar();
i++;
} while (n[i]!='\n');
}
>
void output (char *n)
////////////////////
{
int i=0;
printf ("\noutput :");
do {
printf ("%c" ,n[i]);
i++;
} while (n[i]!='\n');
}
Don't use // comments in usenet messages, they can easily be
wrapped and destroy the code. Also try to post complete compilable
programs, with proper indentation. Don't use tabs, because they
are often lost entirely.

'\n' is just another character. If you know that the input
contains an unread one you can flush it with a routine such as the
following:

int flushln(FILE *f) {
int ch;

while ((EOF != (ch = getc(f)) && ('\n' != ch)) continue;
return ch;
}

Calling this guarantees that any '\n' in the input has been
absorbed. It doesn't ensure that there was such to be absorbed.
Note that the input is stored in an int, so that EOF can be
detected. Also note that all input lines (on a buffered system,
which yours almost certainly is) terminate in a '\n'.

Now let us assume that you want to input lines not exceeding some
sort of maximum length, and are willing to discard any input longer
than that maximum. First you must define the maximum length
somewhere:

#define MAXLGH 80 /* just to pick a number out of the hat */

and somewhere you will have a buffer to hold the lines:

char buffer[MAXLGH];

now you want to call a routine to fill that buffer, and discard any
excess length:

void fillbuf(char *buf, int maxlgh); /* A prototype */

(which I haven't used - I combined it with something that prompts)

Putting things together you might end up with a program that looks
like:

#include <stdio.h>
#define MAXLGH 10

/* -------------- */

int flushln(FILE *f) {
int ch;

while ((EOF != (ch = getc(f))) && ('\n' != ch)) continue;
return ch;
}

/* -------------- */

int getinput(FILE *f, char *buf, int lgh, char *prompt) {
int i;
int ch;

fputs(prompt, stdout);
fflush(stdout);
i = 0;
while ((i < lgh) && (EOF != (ch = getc(f))) && ('\n' != ch)) {
/* study the above condition carefully,
especially the order of tests.
Note that with lgh 0 getc is always called */
buf[i++] = ch;
}
/* Now decide why the loop ended. */
if ('\n' != ch) ch = flushln(f);
/* This assumes that EOF is sticky. Don't worry about it */

/* Now we know that any final '\n' has been absorbed */

/* important - terminate the string */
buf[i] = '\0';
return ch;
}

/* -------------- */

int main(void) {

char buffer[MAXLGH + 1]; /* +1 allows for terminating '/0' */
char prompt[] = "Input: ";

while (EOF != getinput(stdin, buffer, MAXLGH, prompt)) {
fputs("Output: ", stdout); /* no appended '\n' */
puts(buffer); /* which appends a '\n' and forces output */
}
return 0; /* main always returns a value */
}

Note that the program terminates on receiving an EOF signal. How
this is done depends on your system. Under linux that will
probably be a CTL-d key. Under MSDOS or Windows that will probably
be a CTL-z key. Entered immediately after the "Input:" prompt.

Lines terminate on receiving a '\n', generated by the Enter key.
Storage terminates either on line termination or receiving MAXLGH
characters.

Aside: It would be well to add a 'static' in the headers of the
functions (other than main), but this won't affect anything until
you get into more complicated multi-file programs.

getchar() is just shorthand for getc(stdin). Routines are more
flexible when you can aim them at arbitrary files. Keep them as
simple as possible.

Don't use scanf for interactive input. It will always leave
confusion. When and if you do use it always check its return
value.

Carefully read the descriptions of each standard function I have
called. This includes getc, getchar, puts, fputs, fflush. Note
that they all do simple things.

--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home .att.net>
I appreciate your trail to give me a better code but still How can I
fix above code to make the loop like this :
{
..
na[i]=getchar();
+ii;
..
}

and not like this
{
..
+ii;
na[i]=getchar();
..
}

Thanks
How can I begin my index with 0 and not 1 ?
How can I turn my module like this :

{
..
na[i]=getchar();
+ii;
..
}

Dec 18 '06 #22

eh**********@gm ail.com wrote:
CBFalconer wrote:
eh**********@gm ail.com wrote:
>
... snip ...
>
can I read '\n' using getchar() as I do in scanf ("\n") ?????
>
please suggested code :
>
void input (char *n)
////////////////////
{
int i=0;
printf ("\nInput :");
getchar()="\n";
do {
n[i]=getchar();
i++;
} while (n[i]!='\n');
}
>
void output (char *n)
////////////////////
{
int i=0;
printf ("\noutput :");
do {
printf ("%c" ,n[i]);
i++;
} while (n[i]!='\n');
}
Don't use // comments in usenet messages, they can easily be
wrapped and destroy the code. Also try to post complete compilable
programs, with proper indentation. Don't use tabs, because they
are often lost entirely.

'\n' is just another character. If you know that the input
contains an unread one you can flush it with a routine such as the
following:

int flushln(FILE *f) {
int ch;

while ((EOF != (ch = getc(f)) && ('\n' != ch)) continue;
return ch;
}

Calling this guarantees that any '\n' in the input has been
absorbed. It doesn't ensure that there was such to be absorbed.
Note that the input is stored in an int, so that EOF can be
detected. Also note that all input lines (on a buffered system,
which yours almost certainly is) terminate in a '\n'.

Now let us assume that you want to input lines not exceeding some
sort of maximum length, and are willing to discard any input longer
than that maximum. First you must define the maximum length
somewhere:

#define MAXLGH 80 /* just to pick a number out of the hat */

and somewhere you will have a buffer to hold the lines:

char buffer[MAXLGH];

now you want to call a routine to fill that buffer, and discard any
excess length:

void fillbuf(char *buf, int maxlgh); /* A prototype */

(which I haven't used - I combined it with something that prompts)

Putting things together you might end up with a program that looks
like:

#include <stdio.h>
#define MAXLGH 10

/* -------------- */

int flushln(FILE *f) {
int ch;

while ((EOF != (ch = getc(f))) && ('\n' != ch)) continue;
return ch;
}

/* -------------- */

int getinput(FILE *f, char *buf, int lgh, char *prompt) {
int i;
int ch;

fputs(prompt, stdout);
fflush(stdout);
i = 0;
while ((i < lgh) && (EOF != (ch = getc(f))) && ('\n' != ch)) {
/* study the above condition carefully,
especially the order of tests.
Note that with lgh 0 getc is always called */
buf[i++] = ch;
}
/* Now decide why the loop ended. */
if ('\n' != ch) ch = flushln(f);
/* This assumes that EOF is sticky. Don't worry about it */

/* Now we know that any final '\n' has been absorbed */

/* important - terminate the string */
buf[i] = '\0';
return ch;
}

/* -------------- */

int main(void) {

char buffer[MAXLGH + 1]; /* +1 allows for terminating '/0' */
char prompt[] = "Input: ";

while (EOF != getinput(stdin, buffer, MAXLGH, prompt)) {
fputs("Output: ", stdout); /* no appended '\n' */
puts(buffer); /* which appends a '\n' and forces output */
}
return 0; /* main always returns a value */
}

Note that the program terminates on receiving an EOF signal. How
this is done depends on your system. Under linux that will
probably be a CTL-d key. Under MSDOS or Windows that will probably
be a CTL-z key. Entered immediately after the "Input:" prompt.

Lines terminate on receiving a '\n', generated by the Enter key.
Storage terminates either on line termination or receiving MAXLGH
characters.

Aside: It would be well to add a 'static' in the headers of the
functions (other than main), but this won't affect anything until
you get into more complicated multi-file programs.

getchar() is just shorthand for getc(stdin). Routines are more
flexible when you can aim them at arbitrary files. Keep them as
simple as possible.

Don't use scanf for interactive input. It will always leave
confusion. When and if you do use it always check its return
value.

Carefully read the descriptions of each standard function I have
called. This includes getc, getchar, puts, fputs, fflush. Note
that they all do simple things.

--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home .att.net>
I appreciate your trail to give me a better code but still How can I
fix above code to make the loop like this :
{
..
na[i]=getchar();
+ii;
..
}

and not like this
{
..
+ii;
na[i]=getchar();
..
}

Thanks
What is the way of making the module of input like :
{
...
na[i]=getchar();
+ii;
...
}

Dec 18 '06 #23

eh**********@gm ail.com wrote:
CBFalconer wrote:
eh**********@gm ail.com wrote:
>
... snip ...
>
can I read '\n' using getchar() as I do in scanf ("\n") ?????
>
please suggested code :
>
void input (char *n)
////////////////////
{
int i=0;
printf ("\nInput :");
getchar()="\n";
do {
n[i]=getchar();
i++;
} while (n[i]!='\n');
}
>
void output (char *n)
////////////////////
{
int i=0;
printf ("\noutput :");
do {
printf ("%c" ,n[i]);
i++;
} while (n[i]!='\n');
}
Don't use // comments in usenet messages, they can easily be
wrapped and destroy the code. Also try to post complete compilable
programs, with proper indentation. Don't use tabs, because they
are often lost entirely.

'\n' is just another character. If you know that the input
contains an unread one you can flush it with a routine such as the
following:

int flushln(FILE *f) {
int ch;

while ((EOF != (ch = getc(f)) && ('\n' != ch)) continue;
return ch;
}

Calling this guarantees that any '\n' in the input has been
absorbed. It doesn't ensure that there was such to be absorbed.
Note that the input is stored in an int, so that EOF can be
detected. Also note that all input lines (on a buffered system,
which yours almost certainly is) terminate in a '\n'.

Now let us assume that you want to input lines not exceeding some
sort of maximum length, and are willing to discard any input longer
than that maximum. First you must define the maximum length
somewhere:

#define MAXLGH 80 /* just to pick a number out of the hat */

and somewhere you will have a buffer to hold the lines:

char buffer[MAXLGH];

now you want to call a routine to fill that buffer, and discard any
excess length:

void fillbuf(char *buf, int maxlgh); /* A prototype */

(which I haven't used - I combined it with something that prompts)

Putting things together you might end up with a program that looks
like:

#include <stdio.h>
#define MAXLGH 10

/* -------------- */

int flushln(FILE *f) {
int ch;

while ((EOF != (ch = getc(f))) && ('\n' != ch)) continue;
return ch;
}

/* -------------- */

int getinput(FILE *f, char *buf, int lgh, char *prompt) {
int i;
int ch;

fputs(prompt, stdout);
fflush(stdout);
i = 0;
while ((i < lgh) && (EOF != (ch = getc(f))) && ('\n' != ch)) {
/* study the above condition carefully,
especially the order of tests.
Note that with lgh 0 getc is always called */
buf[i++] = ch;
}
/* Now decide why the loop ended. */
if ('\n' != ch) ch = flushln(f);
/* This assumes that EOF is sticky. Don't worry about it */

/* Now we know that any final '\n' has been absorbed */

/* important - terminate the string */
buf[i] = '\0';
return ch;
}

/* -------------- */

int main(void) {

char buffer[MAXLGH + 1]; /* +1 allows for terminating '/0' */
char prompt[] = "Input: ";

while (EOF != getinput(stdin, buffer, MAXLGH, prompt)) {
fputs("Output: ", stdout); /* no appended '\n' */
puts(buffer); /* which appends a '\n' and forces output */
}
return 0; /* main always returns a value */
}

Note that the program terminates on receiving an EOF signal. How
this is done depends on your system. Under linux that will
probably be a CTL-d key. Under MSDOS or Windows that will probably
be a CTL-z key. Entered immediately after the "Input:" prompt.

Lines terminate on receiving a '\n', generated by the Enter key.
Storage terminates either on line termination or receiving MAXLGH
characters.

Aside: It would be well to add a 'static' in the headers of the
functions (other than main), but this won't affect anything until
you get into more complicated multi-file programs.

getchar() is just shorthand for getc(stdin). Routines are more
flexible when you can aim them at arbitrary files. Keep them as
simple as possible.

Don't use scanf for interactive input. It will always leave
confusion. When and if you do use it always check its return
value.

Carefully read the descriptions of each standard function I have
called. This includes getc, getchar, puts, fputs, fflush. Note
that they all do simple things.

--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home .att.net>
I appreciate your trail to give me a better code but still How can I
fix above code to make the loop like this :
{
..
na[i]=getchar();
+ii;
..
}

and not like this
{
..
+ii;
na[i]=getchar();
..
}

Thanks
How can I begin my index with 0 and not 1 ?
How can I turn my module like this :

{
..
na[i]=getchar();
+ii;
..
}

Dec 18 '06 #24

eh**********@gm ail.com wrote:
CBFalconer wrote:
eh**********@gm ail.com wrote:
>
... snip ...
>
can I read '\n' using getchar() as I do in scanf ("\n") ?????
>
please suggested code :
>
void input (char *n)
////////////////////
{
int i=0;
printf ("\nInput :");
getchar()="\n";
do {
n[i]=getchar();
i++;
} while (n[i]!='\n');
}
>
void output (char *n)
////////////////////
{
int i=0;
printf ("\noutput :");
do {
printf ("%c" ,n[i]);
i++;
} while (n[i]!='\n');
}
Don't use // comments in usenet messages, they can easily be
wrapped and destroy the code. Also try to post complete compilable
programs, with proper indentation. Don't use tabs, because they
are often lost entirely.

'\n' is just another character. If you know that the input
contains an unread one you can flush it with a routine such as the
following:

int flushln(FILE *f) {
int ch;

while ((EOF != (ch = getc(f)) && ('\n' != ch)) continue;
return ch;
}

Calling this guarantees that any '\n' in the input has been
absorbed. It doesn't ensure that there was such to be absorbed.
Note that the input is stored in an int, so that EOF can be
detected. Also note that all input lines (on a buffered system,
which yours almost certainly is) terminate in a '\n'.

Now let us assume that you want to input lines not exceeding some
sort of maximum length, and are willing to discard any input longer
than that maximum. First you must define the maximum length
somewhere:

#define MAXLGH 80 /* just to pick a number out of the hat */

and somewhere you will have a buffer to hold the lines:

char buffer[MAXLGH];

now you want to call a routine to fill that buffer, and discard any
excess length:

void fillbuf(char *buf, int maxlgh); /* A prototype */

(which I haven't used - I combined it with something that prompts)

Putting things together you might end up with a program that looks
like:

#include <stdio.h>
#define MAXLGH 10

/* -------------- */

int flushln(FILE *f) {
int ch;

while ((EOF != (ch = getc(f))) && ('\n' != ch)) continue;
return ch;
}

/* -------------- */

int getinput(FILE *f, char *buf, int lgh, char *prompt) {
int i;
int ch;

fputs(prompt, stdout);
fflush(stdout);
i = 0;
while ((i < lgh) && (EOF != (ch = getc(f))) && ('\n' != ch)) {
/* study the above condition carefully,
especially the order of tests.
Note that with lgh 0 getc is always called */
buf[i++] = ch;
}
/* Now decide why the loop ended. */
if ('\n' != ch) ch = flushln(f);
/* This assumes that EOF is sticky. Don't worry about it */

/* Now we know that any final '\n' has been absorbed */

/* important - terminate the string */
buf[i] = '\0';
return ch;
}

/* -------------- */

int main(void) {

char buffer[MAXLGH + 1]; /* +1 allows for terminating '/0' */
char prompt[] = "Input: ";

while (EOF != getinput(stdin, buffer, MAXLGH, prompt)) {
fputs("Output: ", stdout); /* no appended '\n' */
puts(buffer); /* which appends a '\n' and forces output */
}
return 0; /* main always returns a value */
}

Note that the program terminates on receiving an EOF signal. How
this is done depends on your system. Under linux that will
probably be a CTL-d key. Under MSDOS or Windows that will probably
be a CTL-z key. Entered immediately after the "Input:" prompt.

Lines terminate on receiving a '\n', generated by the Enter key.
Storage terminates either on line termination or receiving MAXLGH
characters.

Aside: It would be well to add a 'static' in the headers of the
functions (other than main), but this won't affect anything until
you get into more complicated multi-file programs.

getchar() is just shorthand for getc(stdin). Routines are more
flexible when you can aim them at arbitrary files. Keep them as
simple as possible.

Don't use scanf for interactive input. It will always leave
confusion. When and if you do use it always check its return
value.

Carefully read the descriptions of each standard function I have
called. This includes getc, getchar, puts, fputs, fflush. Note
that they all do simple things.

--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home .att.net>
I appreciate your trail to give me a better code but still How can I
fix above code to make the loop like this :
{
..
na[i]=getchar();
+ii;
..
}

and not like this
{
..
+ii;
na[i]=getchar();
..
}

Thanks
How can I begin my index with 0 and not 1 ?
How can I turn my module like this :

{
..
na[i]=getchar();
+ii;
..
}

Dec 18 '06 #25
eh**********@gm ail.com wrote:
>
.... snip 187 lines ...
>
How can I begin my index with 0 and not 1 ?
How can I turn my module like this :
Ignoring the advice you have received, and posting the same message
4 times in 70 minutes, will not gain you any friends here. I took
some trouble to give you a fairly comprehensive example, but will
not bother in future.

--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home .att.net>
Dec 18 '06 #26

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

Similar topics

3
2245
by: Cam | last post by:
Hi everyone, Before I answer to a (hopefully) helpful reply to this post, I have been rapped over the knuckles for 'top-posting' and I do not wish to be a learner poster who observes poor netiquette as I am a firm believer in consideration .... to this end, could somebody please tell me how I reply to a message without top-posting? Do I need to have my original post selected when I hit the 'reply' button? Here's my question (and...
3
2760
by: Vinicius | last post by:
Hello, the following code does not work: " .... void main(void) { char option; printf("Choose an option: ");
6
1916
by: Luke Wu | last post by:
Whenever one runs across programs that use the return value from getchar() to read input, it's almost always accepted into an int-defined variable. I've read explanations on this and have always used this form. Recently, someone asked me why an int was needed, since -1 (usually EOF) can be safely represented in a signed char value. In fact, any negative number can be safely represented in a signed char value, and wouldn't conflict with...
1
3723
by: White Spirit | last post by:
I'm trying to use getchar() to read alphanumeric data as follows:- char input; /* Take a string of input and remove all spaces therein */ int j = 0; while ((input = getchar()) != '\n') { if (!isspace(input)) j++;
5
8759
by: Jonathan | last post by:
Hi-- I have the following code: #include <stdio.h> char a,b; int main()
6
5281
by: Alan | last post by:
I am using Standard C compiled with GCC under Linux Fedora Core 4 When I run this program and enter a character at the prompt, I have to press the ENTER key as well. This gives me 2 input characters - 'a' and '\n' (Hex 61 and 0a) It seems as though the getchar() function needs ENTER to terminate reading stdin. I am trying to get the program to respond when I press one key only (ie
26
4545
by: tesh.uk | last post by:
Hi Gurus, I have written the following code with the help of Ivor Horton's Beginning C : // Structures, Arrays of Structures. #include "stdafx.h" #include "stdio.h" #define MY_ARRAY 15
12
4726
by: arnuld | last post by:
#include <stdio.h> int main() { printf("%d\n", getchar() != EOF); return 0; } when i run this programme, no matter what i give it as input, output
22
3611
by: arnuld | last post by:
Mostly when I want to take input from stdin I use getchar() but I get this from man page itself: "If the integer value returned by getchar() is stored into a variable of type char and then compared against the integer constant EOF, the comparison may never succeed, because sign-extension of a variable of type char on widening to integer is implementation-defined" while( EOF != (ch = getchar()) ) ....
0
9703
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
9566
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
10555
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...
1
7607
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
6844
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
5636
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4277
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
3802
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2974
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.