Hello everyone. I am frustrated, I have written the simple program
below for a class and I am having problems with the DO-WHILE loop. On
the first run through the loop, everything works well, the menu is
displayed, the input is registered and the loop runs. On the second
(and following) runs the menu is printed twice. I am sure there is
something very basic that I am missing, but I cannot see it. Can
anyone help?
Thanks in advance.
Ken
****Here is the code****
/* currency.c - Version 1.2
This program receives a selection from the
user to determine the type of currency they
would like the exchange rate for. It then returns
the value of the amount of US currency they entered
in the currency type that they selected.*/
#include <stdio.h>
int main()
{
char nation; //Declare variable for the users choice of currencies
float us_dollar;
float canada_conv;
float euro_conv;
float krona_conv;
float yen_conv;
float pound_conv; //Declare variables of Float type
int cont = 0;
canada_conv = 1.2997; //Set exchange rates for all variables
euro_conv = 1.2056;
krona_conv = 7.5625;
yen_conv = 0.009057;
pound_conv = 0.7694;
us_dollar = 1.00; //set initial dollar amount
printf("Currenc y Conversion\n\n" ); //Title of program
do {
cont = 0;
//Prompt user for currency
printf("Which currency would you like to convert?\n\n");
printf("Press 'C' for Canadian Dollars.\n");
printf("Press 'E' for Euros.\n");
printf("Press 'K' for Swedish Krona.\n");
printf("Press 'Y' for Japanese Yen.\n");
printf("Press 'P' for British Pounds.\n\n");
printf("Press 'Q' to quit.\n\n");
nation=getchar( ); //Retrieves users choice and assigns "nation"
variable
switch (nation) //Selection process to give amount based on user
selection
{
case 'C':
case 'c':
printf("\nPleas e enter the US dollar amount you want to
convert.\n\n");
scanf("%f", &us_dollar); //Gather the dollar amount they wish to
convert
printf("\n$%1.2 f US is worth %1.2f Canadian Dollars.\n\n",
us_dollar, us_dollar * canada_conv);
cont = 0;
break;
case 'E':
case 'e':
printf("\nPleas e enter the US dollar amount you want to
convert.\n\n");
scanf("%f", &us_dollar); //Gather the dollar amount they wish to
convert
printf("\n$%1.2 f US is worth %1.2f Euros.\n", us_dollar, us_dollar
* euro_conv);
cont = 0;
break;
case 'K':
case 'k':
printf("\nPleas e enter the US dollar amount you want to
convert.\n\n");
scanf("%f", &us_dollar); //Gather the dollar amount they wish to
convert
printf("\n$%1.2 f US is worth %1.2f Swedish Krona.\n", us_dollar,
us_dollar * krona_conv);
cont = 0;
break;
case 'Y':
case 'y':
printf("\nPleas e enter the US dollar amount you want to
convert.\n\n");
scanf("%f", &us_dollar); //Gather the dollar amount they wish to
convert
printf("\n$%1.2 f US is worth %1.2f Japanese Yen.\n", us_dollar,
us_dollar * yen_conv);
cont = 0;
break;
case 'P':
case 'p':
printf("\nPleas e enter the US dollar amount you want to
convert.\n\n");
scanf("%f", &us_dollar); //Gather the dollar amount they wish to
convert
printf("\n$%1.2 f US is worth %1.2f British Pounds.\n", us_dollar,
us_dollar * pound_conv);
cont = 0;
break;
case 'Q':
case 'q':
cont = 1;
printf("Thanks for using the Currency Conversion program.\n\n");
break;
default: //This is the error check. If the enter an incorrect
choice, they get shut down
break;
}
} while (cont!=1);
//Give user time to see results and end program
printf("\n\nPre ss any key and Enter to exit the program.\n");
scanf("%d");
return 0;
} 13 2218
Hello Ken,
You probably have "leftover characters" in the input buffer following the
call to scanf() - I've seen this before with progs that mix scanf() and
getchar(). Easiest solution, for this program, is not to mix them. Flushing
the buffer would probably work too, but I've not tried it.
Regards,
-Pete.
"Redduck" <ke**********@m ail.com> wrote in message
news:ee******** *************** **@posting.goog le.com... Hello everyone. I am frustrated, I have written the simple program below for a class and I am having problems with the DO-WHILE loop. On the first run through the loop, everything works well, the menu is displayed, the input is registered and the loop runs. On the second (and following) runs the menu is printed twice. I am sure there is something very basic that I am missing, but I cannot see it. Can anyone help?
Thanks in advance.
Ken
****Here is the code****
/* currency.c - Version 1.2 This program receives a selection from the user to determine the type of currency they would like the exchange rate for. It then returns the value of the amount of US currency they entered in the currency type that they selected.*/
#include <stdio.h>
int main() { char nation; //Declare variable for the users choice of currencies
float us_dollar; float canada_conv; float euro_conv; float krona_conv; float yen_conv; float pound_conv; //Declare variables of Float type
int cont = 0;
canada_conv = 1.2997; //Set exchange rates for all variables euro_conv = 1.2056; krona_conv = 7.5625; yen_conv = 0.009057; pound_conv = 0.7694; us_dollar = 1.00; //set initial dollar amount
printf("Currenc y Conversion\n\n" ); //Title of program
do {
cont = 0;
//Prompt user for currency printf("Which currency would you like to convert?\n\n"); printf("Press 'C' for Canadian Dollars.\n"); printf("Press 'E' for Euros.\n"); printf("Press 'K' for Swedish Krona.\n"); printf("Press 'Y' for Japanese Yen.\n"); printf("Press 'P' for British Pounds.\n\n"); printf("Press 'Q' to quit.\n\n");
nation=getchar( ); //Retrieves users choice and assigns "nation" variable
switch (nation) //Selection process to give amount based on user selection { case 'C': case 'c': printf("\nPleas e enter the US dollar amount you want to convert.\n\n"); scanf("%f", &us_dollar); //Gather the dollar amount they wish to convert printf("\n$%1.2 f US is worth %1.2f Canadian Dollars.\n\n", us_dollar, us_dollar * canada_conv); cont = 0; break;
case 'E': case 'e': printf("\nPleas e enter the US dollar amount you want to convert.\n\n"); scanf("%f", &us_dollar); //Gather the dollar amount they wish to convert printf("\n$%1.2 f US is worth %1.2f Euros.\n", us_dollar, us_dollar * euro_conv); cont = 0; break;
case 'K': case 'k': printf("\nPleas e enter the US dollar amount you want to convert.\n\n"); scanf("%f", &us_dollar); //Gather the dollar amount they wish to convert printf("\n$%1.2 f US is worth %1.2f Swedish Krona.\n", us_dollar, us_dollar * krona_conv); cont = 0; break;
case 'Y': case 'y': printf("\nPleas e enter the US dollar amount you want to convert.\n\n"); scanf("%f", &us_dollar); //Gather the dollar amount they wish to convert printf("\n$%1.2 f US is worth %1.2f Japanese Yen.\n", us_dollar, us_dollar * yen_conv); cont = 0; break;
case 'P': case 'p': printf("\nPleas e enter the US dollar amount you want to convert.\n\n"); scanf("%f", &us_dollar); //Gather the dollar amount they wish to convert printf("\n$%1.2 f US is worth %1.2f British Pounds.\n", us_dollar, us_dollar * pound_conv); cont = 0; break;
case 'Q': case 'q': cont = 1; printf("Thanks for using the Currency Conversion program.\n\n"); break;
default: //This is the error check. If the enter an incorrect choice, they get shut down break; }
} while (cont!=1);
//Give user time to see results and end program printf("\n\nPre ss any key and Enter to exit the program.\n"); scanf("%d"); return 0; }
Redduck wrote: Hello everyone. I am frustrated, I have written the simple program below for a class and I am having problems with the DO-WHILE loop. On the first run through the loop, everything works well, the menu is displayed, the input is registered and the loop runs. On the second (and following) runs the menu is printed twice. I am sure there is something very basic that I am missing, but I cannot see it. Can anyone help?
Using function getchar leaves a '\n' char in stdin. A quick
fix would use function fgets in place of getchar. See below. ****Here is the code****
/* currency.c - Version 1.2 This program receives a selection from the user to determine the type of currency they would like the exchange rate for. It then returns the value of the amount of US currency they entered in the currency type that they selected.*/
#include <stdio.h>
int main() { char nation; //Declare variable for the users choice of currencies
make nation a char array, ie.
char nation[8];
float us_dollar; float canada_conv; float euro_conv; float krona_conv; float yen_conv; float pound_conv; //Declare variables of Float type
int cont = 0;
canada_conv = 1.2997; //Set exchange rates for all variables euro_conv = 1.2056; krona_conv = 7.5625; yen_conv = 0.009057; pound_conv = 0.7694; us_dollar = 1.00; //set initial dollar amount
printf("Currenc y Conversion\n\n" ); //Title of program
do {
cont = 0;
//Prompt user for currency printf("Which currency would you like to convert?\n\n"); printf("Press 'C' for Canadian Dollars.\n"); printf("Press 'E' for Euros.\n"); printf("Press 'K' for Swedish Krona.\n"); printf("Press 'Y' for Japanese Yen.\n"); printf("Press 'P' for British Pounds.\n\n"); printf("Press 'Q' to quit.\n\n");
nation=getchar( ); //Retrieves users choice and assigns "nation" variable
use fgets in place of getchar.
fgets(nation, sizeof nation, stdin);
switch (nation) //Selection process to give amount based on user selection
switch(nation[0]);
{
........... snip .............
--
Al Bowers
Tampa, Fl USA
mailto: xa******@myrapi dsys.com (remove the x to send email) http://www.geocities.com/abowers822/
Redduck wrote: Hello everyone. I am frustrated, I have written the simple program below for a class and I am having problems with the DO-WHILE loop. On the first run through the loop, everything works well, the menu is displayed, the input is registered and the loop runs. On the second (and following) runs the menu is printed twice. I am sure there is something very basic that I am missing, but I cannot see it. Can anyone help?
.... snip code ...
As usual the problem is the use of scanf for interactive input.
Think about what is left in the input stream after executing that
call. Also think about other methods of getting the users input
which allow you to be sure of the input stream condition.
--
"It is not a question of staying the course, but of changing
the course" - John Kerry, 2004-09-20
"Ask any boat owner the eventual result of continuing the
present course indefinitely" - C.B. Falconer, 2004-09-20
The problem is of the clearence of the buffer:
Now when u enter the choice then after that u have to clear the buffer also.
As u know that *getchar* takes all the input into the buffer and then from
there it takes the value to the allocated mamory.
And the *getch* takes the each respective character and simultaneously stores
into the allocated memory. and once it over flows the memory sapsce a error
code is desplayed (this thing u have to handle manually)
So try to use the getch instead of getchar:
Or use the fflush function:
in this u will be handle the problem.
any way if u have the doubts then let me know.
Regards
Ranjeet ke**********@ma il.com (Redduck) wrote in message news:<ee******* *************** ***@posting.goo gle.com>... Hello everyone. I am frustrated, I have written the simple program below for a class and I am having problems with the DO-WHILE loop. On the first run through the loop, everything works well, the menu is displayed, the input is registered and the loop runs. On the second (and following) runs the menu is printed twice. I am sure there is something very basic that I am missing, but I cannot see it. Can anyone help?
Thanks in advance.
Ken
****Here is the code****
/* currency.c - Version 1.2 This program receives a selection from the user to determine the type of currency they would like the exchange rate for. It then returns the value of the amount of US currency they entered in the currency type that they selected.*/
#include <stdio.h>
int main() { char nation; //Declare variable for the users choice of currencies
float us_dollar; float canada_conv; float euro_conv; float krona_conv; float yen_conv; float pound_conv; //Declare variables of Float type
int cont = 0;
canada_conv = 1.2997; //Set exchange rates for all variables euro_conv = 1.2056; krona_conv = 7.5625; yen_conv = 0.009057; pound_conv = 0.7694; us_dollar = 1.00; //set initial dollar amount
printf("Currenc y Conversion\n\n" ); //Title of program
do {
cont = 0;
//Prompt user for currency printf("Which currency would you like to convert?\n\n"); printf("Press 'C' for Canadian Dollars.\n"); printf("Press 'E' for Euros.\n"); printf("Press 'K' for Swedish Krona.\n"); printf("Press 'Y' for Japanese Yen.\n"); printf("Press 'P' for British Pounds.\n\n"); printf("Press 'Q' to quit.\n\n");
nation=getchar( ); //Retrieves users choice and assigns "nation" variable
switch (nation) //Selection process to give amount based on user selection { case 'C': case 'c': printf("\nPleas e enter the US dollar amount you want to convert.\n\n"); scanf("%f", &us_dollar); //Gather the dollar amount they wish to convert printf("\n$%1.2 f US is worth %1.2f Canadian Dollars.\n\n", us_dollar, us_dollar * canada_conv); cont = 0; break;
case 'E': case 'e': printf("\nPleas e enter the US dollar amount you want to convert.\n\n"); scanf("%f", &us_dollar); //Gather the dollar amount they wish to convert printf("\n$%1.2 f US is worth %1.2f Euros.\n", us_dollar, us_dollar * euro_conv); cont = 0; break;
case 'K': case 'k': printf("\nPleas e enter the US dollar amount you want to convert.\n\n"); scanf("%f", &us_dollar); //Gather the dollar amount they wish to convert printf("\n$%1.2 f US is worth %1.2f Swedish Krona.\n", us_dollar, us_dollar * krona_conv); cont = 0; break;
case 'Y': case 'y': printf("\nPleas e enter the US dollar amount you want to convert.\n\n"); scanf("%f", &us_dollar); //Gather the dollar amount they wish to convert printf("\n$%1.2 f US is worth %1.2f Japanese Yen.\n", us_dollar, us_dollar * yen_conv); cont = 0; break;
case 'P': case 'p': printf("\nPleas e enter the US dollar amount you want to convert.\n\n"); scanf("%f", &us_dollar); //Gather the dollar amount they wish to convert printf("\n$%1.2 f US is worth %1.2f British Pounds.\n", us_dollar, us_dollar * pound_conv); cont = 0; break;
case 'Q': case 'q': cont = 1; printf("Thanks for using the Currency Conversion program.\n\n"); break;
default: //This is the error check. If the enter an incorrect choice, they get shut down break; }
} while (cont!=1);
//Give user time to see results and end program printf("\n\nPre ss any key and Enter to exit the program.\n"); scanf("%d"); return 0; }
Here is your code corredtion it will work fine..... Enjoy :
"Pete Gray" <pe******@ieee. org> wrote in message news:<gxL3d.199 22$wV.4542@attb i_s54>... Hello Ken,
You probably have "leftover characters" in the input buffer following the call to scanf() - I've seen this before with progs that mix scanf() and getchar(). Easiest solution, for this program, is not to mix them. Flushing the buffer would probably work too, but I've not tried it.
Regards, -Pete.
"Redduck" <ke**********@m ail.com> wrote in message news:ee******** *************** **@posting.goog le.com... Hello everyone. I am frustrated, I have written the simple program below for a class and I am having problems with the DO-WHILE loop. On the first run through the loop, everything works well, the menu is displayed, the input is registered and the loop runs. On the second (and following) runs the menu is printed twice. I am sure there is something very basic that I am missing, but I cannot see it. Can anyone help?
Thanks in advance.
Ken
****Here is the code****
/* currency.c - Version 1.2 This program receives a selection from the user to determine the type of currency they would like the exchange rate for. It then returns the value of the amount of US currency they entered in the currency type that they selected.*/
#include <stdio.h>
int main() { char nation; //Declare variable for the users choice of currencies
float us_dollar; float canada_conv; float euro_conv; float krona_conv; float yen_conv; float pound_conv; //Declare variables of Float type
int cont = 0;
canada_conv = 1.2997; //Set exchange rates for all variables euro_conv = 1.2056; krona_conv = 7.5625; yen_conv = 0.009057; pound_conv = 0.7694; us_dollar = 1.00; //set initial dollar amount
printf("Currenc y Conversion\n\n" ); //Title of program
do {
cont = 0;
//Prompt user for currency printf("Which currency would you like to convert?\n\n"); printf("Press 'C' for Canadian Dollars.\n"); printf("Press 'E' for Euros.\n"); printf("Press 'K' for Swedish Krona.\n"); printf("Press 'Y' for Japanese Yen.\n"); printf("Press 'P' for British Pounds.\n\n"); printf("Press 'Q' to quit.\n\n");
nation=getchar( ); //Retrieves users choice and assigns "nation" variable
getchar(); // this is used to take the character when u press the enter.
// other wise it will re take the character agin and
// whicle loop is going to operate two times.... here is the
// main problem
switch (nation) //Selection process to give amount based on user selection { case 'C': case 'c': printf("\nPleas e enter the US dollar amount you want to convert.\n\n"); scanf("%f", &us_dollar); //Gather the dollar amount they wish to convert printf("\n$%1.2 f US is worth %1.2f Canadian Dollars.\n\n", us_dollar, us_dollar * canada_conv); cont = 0; break;
case 'E': case 'e': printf("\nPleas e enter the US dollar amount you want to convert.\n\n"); scanf("%f", &us_dollar); //Gather the dollar amount they wish to convert printf("\n$%1.2 f US is worth %1.2f Euros.\n", us_dollar, us_dollar * euro_conv); cont = 0; break;
case 'K': case 'k': printf("\nPleas e enter the US dollar amount you want to convert.\n\n"); scanf("%f", &us_dollar); //Gather the dollar amount they wish to convert printf("\n$%1.2 f US is worth %1.2f Swedish Krona.\n", us_dollar, us_dollar * krona_conv); cont = 0; break;
case 'Y': case 'y': printf("\nPleas e enter the US dollar amount you want to convert.\n\n"); scanf("%f", &us_dollar); //Gather the dollar amount they wish to convert printf("\n$%1.2 f US is worth %1.2f Japanese Yen.\n", us_dollar, us_dollar * yen_conv); cont = 0; break;
case 'P': case 'p': printf("\nPleas e enter the US dollar amount you want to convert.\n\n"); scanf("%f", &us_dollar); //Gather the dollar amount they wish to convert printf("\n$%1.2 f US is worth %1.2f British Pounds.\n", us_dollar, us_dollar * pound_conv); cont = 0; break;
case 'Q': case 'q': cont = 1; printf("Thanks for using the Currency Conversion program.\n\n"); break;
default: //This is the error check. If the enter an incorrect choice, they get shut down break; }
} while (cont!=1);
//Give user time to see results and end program printf("\n\nPre ss any key and Enter to exit the program.\n"); scanf("%d");
why u r using scanf("%d");
remove this..... return 0; }
ranjeet wrote: use the getch instead
getch isn't part of the standard library.
What you do in the privacy of your own home,
is your own business, but no getch here.
--
pete ra***********@g mail.com (ranjeet) wrote:
[ Learn to snip. Do not use cuteisms such as "u" for "you".
Do not top-post. ] The problem is of the clearence of the buffer:
Now when u enter the choice then after that u have to clear the buffer also.
As u know that *getchar* takes all the input into the buffer and then from there it takes the value to the allocated mamory.
And the *getch*
There is no getch() in C. There's a getch() in curses, and one in conio;
neither is on-topic here, and in fact IIRC they behave similarly, but
not identically.
So try to use the getch instead of getchar:
Do not do this.
Or use the fflush function:
You can't fflush() an input stream.
All you need to do is filter out the newlines. With the hints of the
other posts in this thread, that shouldn't be hard.
Richard
ranjeet wrote: The problem is of the clearence of the buffer:
Now when u enter the choice then after that u have to clear the buffer also.
Please do not use silly abbreviations such as 'u' in c.l.c. It is
highly annoying and hard to read. Also do not toppost, your
answer belongs after (or intermixed with) the material to which
you reply, after snipping anything not germane to your answer.
--
"It is not a question of staying the course, but of changing
the course" - John Kerry, 2004-09-20
"Ask any boat owner the eventual result of continuing the
present course indefinitely" - C.B. Falconer, 2004-09-20 ke**********@ma il.com (Redduck) wrote in message news:<ee******* *************** ***@posting.goo gle.com>... Hello everyone. I am frustrated, I have written the simple program below for a class and I am having problems with the DO-WHILE loop. On the first run through the loop, everything works well, the menu is displayed, the input is registered and the loop runs. On the second (and following) runs the menu is printed twice. I am sure there is something very basic that I am missing, but I cannot see it. Can anyone help?
Thanks in advance.
Ken
****Here is the code****
/* currency.c - Version 1.2 This program receives a selection from the user to determine the type of currency they would like the exchange rate for. It then returns the value of the amount of US currency they entered in the currency type that they selected.*/
#include <stdio.h>
int main() { char nation; //Declare variable for the users choice of currencies
float us_dollar; float canada_conv; float euro_conv; float krona_conv; float yen_conv; float pound_conv; //Declare variables of Float type
int cont = 0;
canada_conv = 1.2997; //Set exchange rates for all variables euro_conv = 1.2056; krona_conv = 7.5625; yen_conv = 0.009057; pound_conv = 0.7694; us_dollar = 1.00; //set initial dollar amount
printf("Currenc y Conversion\n\n" ); //Title of program
do {
cont = 0;
//Prompt user for currency printf("Which currency would you like to convert?\n\n"); printf("Press 'C' for Canadian Dollars.\n"); printf("Press 'E' for Euros.\n"); printf("Press 'K' for Swedish Krona.\n"); printf("Press 'Y' for Japanese Yen.\n"); printf("Press 'P' for British Pounds.\n\n"); printf("Press 'Q' to quit.\n\n");
nation=getchar( ); //Retrieves users choice and assigns "nation" variable
OVER HERE U JUST ADD ONE MORE STAEMENT getchar();
every thing will work fine.
switch (nation) //Selection process to give amount based on user selection { case 'C': case 'c': printf("\nPleas e enter the US dollar amount you want to convert.\n\n"); scanf("%f", &us_dollar); //Gather the dollar amount they wish to convert printf("\n$%1.2 f US is worth %1.2f Canadian Dollars.\n\n", us_dollar, us_dollar * canada_conv); cont = 0; break;
case 'E': case 'e': printf("\nPleas e enter the US dollar amount you want to convert.\n\n"); scanf("%f", &us_dollar); //Gather the dollar amount they wish to convert printf("\n$%1.2 f US is worth %1.2f Euros.\n", us_dollar, us_dollar * euro_conv); cont = 0; break;
case 'K': case 'k': printf("\nPleas e enter the US dollar amount you want to convert.\n\n"); scanf("%f", &us_dollar); //Gather the dollar amount they wish to convert printf("\n$%1.2 f US is worth %1.2f Swedish Krona.\n", us_dollar, us_dollar * krona_conv); cont = 0; break;
case 'Y': case 'y': printf("\nPleas e enter the US dollar amount you want to convert.\n\n"); scanf("%f", &us_dollar); //Gather the dollar amount they wish to convert printf("\n$%1.2 f US is worth %1.2f Japanese Yen.\n", us_dollar, us_dollar * yen_conv); cont = 0; break;
case 'P': case 'p': printf("\nPleas e enter the US dollar amount you want to convert.\n\n"); scanf("%f", &us_dollar); //Gather the dollar amount they wish to convert printf("\n$%1.2 f US is worth %1.2f British Pounds.\n", us_dollar, us_dollar * pound_conv); cont = 0; break;
case 'Q': case 'q': cont = 1; printf("Thanks for using the Currency Conversion program.\n\n"); break;
default: //This is the error check. If the enter an incorrect choice, they get shut down break; }
} while (cont!=1);
//Give user time to see results and end program printf("\n\nPre ss any key and Enter to exit the program.\n"); scanf("%d"); return 0; } This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Aaron Prohaska |
last post by:
I have just run into a problem where I have a page that posts back to
itself to execute code, except when the page does the post back it
somehow executes code that is in our home page for the site. The only
reason I know that is happening is because I keep track of the pages
executed by the user to see how they have traversed the site. Has anyone
every seen anything like this before?
Regards,
Aaron Prohaska
|
by: Refky Wahib |
last post by:
Hi
I need Technical Support
I finished a Great project using .Net and SQL Server and .Net Mobile
Control
My Business case is to implement this Program to accept about 1
Million concurrent users
So I designed the project as master Node that has all administration
|
by: Leslaw Bieniasz |
last post by:
Cracow, 20.09.2004
Hello,
I need to implement a library containing a hierarchy of classes
together with some binary operations on objects. To fix attention,
let me assume that it is a hierarchy of algebraic matrices with the
addition operation. Thus, I want to have a virtual base class
class Matr;
|
by: Jon Slaughter |
last post by:
I'm having a little trouble understanding what the slicing problem is.
In B.S.'s C++ PL3rdEd he says
"Becayse the Employee copy functions do not know anything about Managers,
only the Employee part of Manager is copied. "....
and gives the code above as
.....
|
by: Ian Stanley |
last post by:
Hi,
Continuing my strcat segmentation fault posting-
I have a problem which occurs when appending two sting literals using
strcat.
I have tried to fix it by writing my own function that does the strcat
(mystract). Program below.
However this appears not to have fixed the problem and I don't know why it
shouldn't ?
Any further help as to what else I am doing wrong will be appreciated
regards
| |
by: Refky Wahib |
last post by:
Hi
Actually I need Technical Support
I finished a Great project using .Net and SQL Server and .Net Mobile
Control
My Business case is to implement this Program to accept about 1
Million concurrent users
So I designed the project as master Node that has all administration
project and about 10 client Nodes
Those subscribers will login and I configured the replication at
Server that can publish any change to the Nodes
|
by: Trond Meistad |
last post by:
I have a website where I run a simple asp.net web application. On
Sunday night, requests to this webapplication started to time out.
After much debuggeing with no result, I created a new webapplication
with one aspx page that displays only a text. I uploaded this page and
the dll, but requests to this page also times out.
So my problem seems to be:
If I request an aspx page, this request times out. The page gives no
error mesage, it...
|
by: Ammar |
last post by:
Dear All,
I'm facing a small problem.
I have a portal web site, that contains articles, for each article, the end
user can send a comment about the article.
The problem is:
I the comment length is more that 1249 bytes, then the progress bar of the
browser will move too slow and then displaying that the page not found!!!!
If the message is less than or equal to 1249 then no problem.
|
by: IkBenHet |
last post by:
Hello,
I use this script to upload image files to a folder on a IIS6 server:
******************* START UPLOAD.ASPX FILE **********************
<%@ Page Language="VB" Debug="true" %>
|
by: TPJ |
last post by:
Help me please, because I really don't get it. I think it's some stupid
mistake I make, but I just can't find it. I have been thinking about it
for three days so far and I still haven't found any solution.
My code can be downloaded from here:
http://www.tprimke.net/konto/PyObject-problem.tar.bz2. There are some
scripts for GNU/Linux system (bash to be precise).
All you need to know is that there are four classes. (Of course, you
may...
|
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...
| |
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,...
|
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...
|
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,...
|
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...
|
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...
|
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...
| |
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
|
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...
| |