473,385 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

A base conversion~ help me to correct it since it can't run

// Base Conversion
// Aim: This program is to convert an inputted number
// from base M into base N. Display the converted
// number in base N.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define LENGTH 20

int temp, m, n, i, r, base10, true;
char num[LENGTH], result[LENGTH];

// This function is to convert a number in base M
// into a number in base 10.
void baseM_to_base10(void)
{
base10 = 0;
for( i=0; i<20 && true = 1; i++) // get the number from base N
{ num[i] = getchar(); // sub. the number into string
if (num == '\n')
{num[i] = '\0'; // if the above statement is true , num[i] will
equal end of string
true = 0 ; }} // end
fflush(stdin); // wash away the excess char
for(i = strlen(num) - 1; i >=0; i--)
{if(num[i] == '1')
base10 = base10 + 1 * pow(2 , strlen(num)- 1 - i);
}
}

// This function is to convert a number in base 10
// into a number in base N.
void base10_to_baseN(unsigned long long number,unsigned short base)
{
unsigned short temp[30],i;
for (i=0;i<30 && number<base;i++)
{
temp[i] = number % base;
number = number / base;
}
temp[i] = number;
printf("The number in %u base is : ",base);
for (i=29;i<30;i--)
{
if (temp[i]<10)
printf("%u",temp);
if (temp[i]>10 || temp[i]<36)
printf("%uc",temp[i]+51);
}
}

main()
{
// m - base M (input base)
// n - base N (output base)
// num - inputted number in base M
// result - converted number in base N

// Variable Declaration
// Prompt the user to enter data required.
printf("Base Conversion\n");
printf("---------------\n");
printf("Please enter an inputted number: ");
scanf("%s",num);
printf("Base M (2 to 36): ");
scanf("%d",&m);
printf("Base N (2 to 36): ");
scanf("%d",&n);
printf("Result is %d \n", result);
// Perform Base Conversion
// - Call function baseM_to_base10 to convert the number
accordingly
// - Call function base10_to_baseN to convert the number
accordingly

// Display the converted number
system("PAUSE");
}

// The End Of Main Program

Mar 4 '07 #1
11 2672

jy****@gmail.com wrote:
// Base Conversion
// Aim: This program is to convert an inputted number
// from base M into base N. Display the converted
// number in base N.
/**/ style is better in C.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define LENGTH 20

int temp, m, n, i, r, base10, true;
char num[LENGTH], result[LENGTH];

// This function is to convert a number in base M
// into a number in base 10.
void baseM_to_base10(void)
{
base10 = 0;
for( i=0; i<20 && true = 1; i++) // get the number from base N
I haven't read all of the code. Are you sure you want 'true=1'? Should
it be 'true == 1'?
{ num[i] = getchar(); // sub. the number into string
if (num == '\n')
'num' is an array, but '\n' is a char. You can NOT compare them.
{num[i] = '\0'; // if the above statement is true , num[i] will
equal end of string
true = 0 ; }} // end
fflush(stdin); // wash away the excess char
for(i = strlen(num) - 1; i >=0; i--)
{if(num[i] == '1')
base10 = base10 + 1 * pow(2 , strlen(num)- 1 - i);
Are you sure you should use pow instead of '<<'? If so, why don't you
include math.h?
}
}

// This function is to convert a number in base 10
// into a number in base N.
void base10_to_baseN(unsigned long long number,unsigned short base)
{
unsigned short temp[30],i;
for (i=0;i<30 && number<base;i++)
{
temp[i] = number % base;
number = number / base;
}
temp[i] = number;
printf("The number in %u base is : ",base);
for (i=29;i<30;i--)
{
if (temp[i]<10)
printf("%u",temp);
Suspicious.
if (temp[i]>10 || temp[i]<36)
printf("%uc",temp[i]+51);
}
}

main()
'int main(void)' is better.
{
// m - base M (input base)
// n - base N (output base)
// num - inputted number in base M
// result - converted number in base N

// Variable Declaration
// Prompt the user to enter data required.
printf("Base Conversion\n");
printf("---------------\n");
printf("Please enter an inputted number: ");
scanf("%s",num);
printf("Base M (2 to 36): ");
scanf("%d",&m);
printf("Base N (2 to 36): ");
scanf("%d",&n);
printf("Result is %d \n", result);
// Perform Base Conversion
// - Call function baseM_to_base10 to convert the number
accordingly
// - Call function base10_to_baseN to convert the number
accordingly

// Display the converted number
system("PAUSE");
'Pause' is NOT available in Linux, so that's NOT portable.
}

// The End Of Main Program
Mar 4 '07 #2
<jy****@gmail.comwrote:
// Base Conversion
// Aim: This program is to convert an inputted number
// from base M into base N. Display the converted
// number in base N.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define LENGTH 20
<snip>

The following code compiles and runs on MingW but produces the wrong answer.
I fixed some problems caused by line breaks on newsgroups and put in what
was my guess as to what you wanted in a few places. I didn't attack - or
even look at - the logic. As I understand your question you wanted to be
able to run. it runs now, for me. I didn't draw attention to changes I
made, you should be able to see what I did from the error messages you get.
No error message was far removed from the error message.

I find your user prompts confusing. How about :input base, output base and
nbr?
int temp, m, n, i, r, base10, true;
char num[LENGTH], result[LENGTH];

// This function is to convert a number in base M
// into a number in base 10.
void baseM_to_base10(void)
{
base10 = 0;
for( i=0; i<20 && true = 1; i++) // get the number from base N
{ num[i] = getchar(); // sub. the number into string
if (num == '\n')
{num[i] = '\0'; // if the above statement is true , num[i] will
equal end of string
true = 0 ; }} // end
fflush(stdin); // wash away the excess char
for(i = strlen(num) - 1; i >=0; i--)
{if(num[i] == '1')
base10 = base10 + 1 * pow(2 , strlen(num)- 1 - i);
}
}

// This function is to convert a number in base 10
// into a number in base N.
void base10_to_baseN(unsigned long long number,unsigned short base)
{
unsigned short temp[30],i;
for (i=0;i<30 && number<base;i++)
{
temp[i] = number % base;
number = number / base;
}
temp[i] = number;
printf("The number in %u base is : ",base);
for (i=29;i<30;i--)
{
if (temp[i]<10)
printf("%u",temp);
if (temp[i]>10 || temp[i]<36)
printf("%uc",temp[i]+51);
}
}

main()
{
// m - base M (input base)
// n - base N (output base)
// num - inputted number in base M
// result - converted number in base N

// Variable Declaration
// Prompt the user to enter data required.
printf("Base Conversion\n");
printf("---------------\n");
printf("Please enter an inputted number: ");
scanf("%s",num);
printf("Base M (2 to 36): ");
scanf("%d",&m);
printf("Base N (2 to 36): ");
scanf("%d",&n);
printf("Result is %d \n", result);
// Perform Base Conversion
// - Call function baseM_to_base10 to convert the number
accordingly
// - Call function base10_to_baseN to convert the number
accordingly

// Display the converted number
system("PAUSE");
}

// The End Of Main Program

>
int temp, m, n, i, r, base10, true;
char num[LENGTH], result[LENGTH];

// This function is to convert a number in base M
// into a number in base 10.
void baseM_to_base10(void)
{
base10 = 0;
for( i=0; i<20 && true = 1; i++) // get the number from base N
{ num[i] = getchar(); // sub. the number into string
if (num == '\n')
{num[i] = '\0'; // if the above statement is true , num[i] will
equal end of string
true = 0 ; }} // end
fflush(stdin); // wash away the excess char
for(i = strlen(num) - 1; i >=0; i--)
{if(num[i] == '1')
base10 = base10 + 1 * pow(2 , strlen(num)- 1 - i);
}
}

// This function is to convert a number in base 10
// into a number in base N.
void base10_to_baseN(unsigned long long number,unsigned short base)
{
unsigned short temp[30],i;
for (i=0;i<30 && number<base;i++)
{
temp[i] = number % base;
number = number / base;
}
temp[i] = number;
printf("The number in %u base is : ",base);
for (i=29;i<30;i--)
{
if (temp[i]<10)
printf("%u",temp);
if (temp[i]>10 || temp[i]<36)
printf("%uc",temp[i]+51);
}
}

main()
{
// m - base M (input base)
// n - base N (output base)
// num - inputted number in base M
// result - converted number in base N

// Variable Declaration
// Prompt the user to enter data required.
printf("Base Conversion\n");
printf("---------------\n");
printf("Please enter an inputted number: ");
scanf("%s",num);
printf("Base M (2 to 36): ");
scanf("%d",&m);
printf("Base N (2 to 36): ");
scanf("%d",&n);
printf("Result is %d \n", result);
// Perform Base Conversion
// - Call function baseM_to_base10 to convert the number
accordingly
// - Call function base10_to_baseN to convert the number
accordingly

// Display the converted number
system("PAUSE");
}

// The End Of Main Program

Mar 4 '07 #3
"osmium" <r1********@comcast.netwrote:
The following code compiles and runs on MingW but produces the wrong
answer. I fixed some problems caused by line breaks on newsgroups and put
in what was my guess as to what you wanted in a few places. I didn't
attack - or even look at - the logic. As I understand your question you
wanted to be able to run. it runs now, for me. I didn't draw attention
to changes I made, you should be able to see what I did from the error
messages you get. No error message was far removed from the error message.
No error message was far removed from the error.
Mar 4 '07 #4
jy****@gmail.com wrote:
// Base Conversion
// Aim: This program is to convert an inputted number
// from base M into base N. Display the converted
// number in base N.
Atleast for posting to Usenet, the C style, (i.e. /* ... */) comments
are better.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define LENGTH 20

int temp, m, n, i, r, base10, true;
char num[LENGTH], result[LENGTH];

// This function is to convert a number in base M
// into a number in base 10.
void baseM_to_base10(void)
{
base10 = 0;
for( i=0; i<20 && true = 1; i++) // get the number from base N
ITYM true == 1;. Also use LENGTH instead of an hardcoded value.
{ num[i] = getchar(); // sub. the number into string
getchar returns an int value to signal EOF, in case of failure. Only
after having checked it against EOF should you assign it to a char
object. Aside from that I think your whole statement is wrong. Why not
use fgets to input a line, check whether it's a valid number with for
example strtol or something else and then assign it to num?
if (num == '\n')
An array name is a pointer to the first element of the array. Here
you're comparing a pointer constant to a char. You should compare a
particular element of num against '\n', like num[i] == '\n'.
{num[i] = '\0'; // if the above statement is true , num[i] will
equal end of string
This is the reason why C++ comments are discouraged in postings to
newsgroups.
true = 0 ; }} // end
fflush(stdin); // wash away the excess char
fflush is only defined for output streams. fflush with stdin leads to
undefined behaviour. Use a simple while loop with getchar or getc and
encapsulate it into a convenient function.
for(i = strlen(num) - 1; i >=0; i--)
{if(num[i] == '1')
base10 = base10 + 1 * pow(2 , strlen(num)- 1 - i);
What exactly does this do?
Also where have you included math.h for pow?
}
}

// This function is to convert a number in base 10
// into a number in base N.
void base10_to_baseN(unsigned long long number,unsigned short base)
{
unsigned short temp[30],i;
for (i=0;i<30 && number<base;i++)
{
temp[i] = number % base;
number = number / base;
}
temp[i] = number;
Assigning a long long type to a short.
printf("The number in %u base is : ",base);
Use %hu for unsigned short. Also terminate printf strings with a
newline or call fflush(stdout) immediately afterwards if you want to
ensure output is to appear synchronously.
for (i=29;i<30;i--)
{
if (temp[i]<10)
printf("%u",temp);
ITYM an element of temp.
if (temp[i]>10 || temp[i]<36)
printf("%uc",temp[i]+51);
What's this supposed to do?
}
}

main()
{
// m - base M (input base)
// n - base N (output base)
// num - inputted number in base M
// result - converted number in base N

// Variable Declaration
// Prompt the user to enter data required.
printf("Base Conversion\n");
printf("---------------\n");
printf("Please enter an inputted number: ");
scanf("%s",num);
Specify a length argument along with scanf for string input. Otherwise
it's as dangerous as gets.
printf("Base M (2 to 36): ");
scanf("%d",&m);
printf("Base N (2 to 36): ");
scanf("%d",&n);
printf("Result is %d \n", result);
You're attempting to print a pointer value as an integer. That's
undefined behaviour. To print a pointer value use the p conversion
specifier or print a particular element of result, (since you've
declared it as an array), or print out the whole array through a for
loop, or print a string in the array, if one is present, with a %s
format specifer and result as the corresponding argument.
// Perform Base Conversion
// - Call function baseM_to_base10 to convert the number
accordingly
// - Call function base10_to_baseN to convert the number
accordingly

// Display the converted number
system("PAUSE");
Non-portable. Use getchar for the same effect.
}

// The End Of Main Program
You're taking on a too ambitious project at too early a time in your
study of C. You've several fundamental misunderstandings and your
program; it is very, very fragile, and broken. At a minimum fix the
mistakes I've pointed out and try again.

Mar 4 '07 #5
osmium wrote:
<jy****@gmail.comwrote:
// Base Conversion
// Aim: This program is to convert an inputted number
// from base M into base N. Display the converted
// number in base N.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define LENGTH 20

<snip>

The following code compiles and runs on MingW but produces the wrong answer.
I fixed some problems caused by line breaks on newsgroups and put in what
was my guess as to what you wanted in a few places.
<snip>

I did not notice any changes in your reposting of the OP's code.

Mar 4 '07 #6
"santosh" wrote:
osmium wrote:
>The following code compiles and runs on MingW but produces the wrong
answer.
I fixed some problems caused by line breaks on newsgroups and put in what
was my guess as to what you wanted in a few places.
I did not notice any changes in your reposting of the OP's code.
// Base Conversion
// Aim: This program is to convert an inputted number
// from base M into base N. Display the converted
// number in base N.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define LENGTH 20

int temp, m, n, i, r, base10, true;
char num[LENGTH], result[LENGTH];

// This function is to convert a number in base M
// into a number in base 10.
void baseM_to_base10(void)
{
base10 = 0;
for( i=0; i<20 && true == 1; i++) // get the number from base N

^^^^^

{ num[i] = getchar(); // sub. the number into string
if (num[i] == '\n')
{num[i] = '\0'; // if the above statement is true , num[i] will

^^^^

//equal end of string

true = 0 ; }} // end
fflush(stdin); // wash away the excess char
for(i = strlen(num) - 1; i >=0; i--)
{if(num[i] == '1')
base10 = base10 + 1 * pow(2 , strlen(num)- 1 - i);
}
}

// This function is to convert a number in base 10
// into a number in base N.
void base10_to_baseN(unsigned long long number,unsigned short base)
{
unsigned short temp[30],i;
for (i=0;i<30 && number<base;i++)
{
temp[i] = number % base;
number = number / base;
}
temp[i] = number;
printf("The number in %u base is : ",base);
for (i=29;i<30;i--)
{
if (temp[i]<10)
printf("%u",temp);
if (temp[i]>10 || temp[i]<36)
printf("%uc",temp[i]+51);
}
}

main()
{
// m - base M (input base)
// n - base N (output base)
// num - inputted number in base M
// result - converted number in base N

// Variable Declaration
// Prompt the user to enter data required.
printf("Base Conversion\n");
printf("---------------\n");
printf("Please enter an inputted number: ");
scanf("%s",num);
printf("Base M (2 to 36): ");
scanf("%d",&m);
printf("Base N (2 to 36): ");
scanf("%d",&n);
printf("Result is %d \n", result);
// Perform Base Conversion
// - Call function baseM_to_base10 to convert the number
//accordingly
// - Call function base10_to_baseN to convert the number
//accordingly

// Display the converted number
system("PAUSE");
}

// The End Of Main Program

I'll be darned! My post was a problem to me because of the OPs character
set and I will blame it on that. Here is another cut and paste from my
compiler's editor. I have marked the two actual changes I recall, but there
may be more..
Mar 4 '07 #7
jy****@gmail.com wrote:
>
.... snip ...

Put your question in the body of the article in future.

Try this:

#include "dispbase.h"

/* ============================================ */
/* Mask and convert digit to hex representation */
/* Output range is 0..9 and a..f only */
int tio_hexify(unsigned int value)
{
int result;

result = (value & 0x0f) + '0';
if (result '9')
result = result + ('a' - '0' - 10);
return result;
} /* tio_hexify */

/* ========================================= */
/* convert number to string in various bases */
/* 2 <= base <= 16, controlled by hexify() */
/* Output string has ls digit first. */
void tio_basedisplay(unsigned long number, unsigned int base,
char * string, size_t maxlgh)
{
/* assert (string[maxlgh]) is valid storage */
if (!maxlgh) {
*string = '\0';
return;
}
else {
*string = tio_hexify(number % base);
if (!number) *string = '\0';
else {
tio_basedisplay(number / base, base, &string[1], maxlgh -
1);
}
}
} /* tio_basedisplay */

/* ======================= */
/* reverse string in place */
void tio_revstring(char * string)
{
char * last, temp;

last = string + strlen(string); /* points to '\0' */
while (last-- string) {
temp = *string; *string++ = *last; *last = temp;
}
} /* tio_revstring */

And the header file:

#ifndef dispbase_h_
#define dispbase_h_

#include <string.h>

/* ============================================ */
/* Mask and convert digit to hex representation */
/* Output range is 0..9 and a..f only */
int tio_hexify(unsigned int value);

/* ========================================= */
/* convert number to string in various bases */
/* 2 <= base <= 16, controlled by hexify() */
/* Output string has ls digit first. */
void tio_basedisplay(unsigned long number, unsigned int base,
char * string, size_t maxlgh);

/* ======================= */
/* reverse string in place */
void tio_revstring(char * string);

#endif
--
<http://www.cs.auckland.ac.nz/~pgut001/pubs/vista_cost.txt>
<http://www.securityfocus.com/columnists/423>

"A man who is right every time is not likely to do very much."
-- Francis Crick, co-discover of DNA
"There is nothing more amazing than stupidity in action."
-- Thomas Matthews
Mar 4 '07 #8
On 3¤ë5¤é, ¤W¤È1®É14¤À, CBFalconer <cbfalco...@yahoo.comwrote:
jyc...@gmail.com wrote:

... snip ...

Put your question in the body of the article in future.

Try this:

#include "dispbase.h"

/* ============================================ */
/* Mask and convert digit to hex representation */
/* Output range is 0..9 and a..f only */
int tio_hexify(unsigned int value)
{
int result;

result = (value & 0x0f) + '0';
if (result '9')
result = result + ('a' - '0' - 10);
return result;

} /* tio_hexify */

/* ========================================= */
/* convert number to string in various bases */
/* 2 <=base<= 16, controlled by hexify() */
/* Output string has ls digit first. */
void tio_basedisplay(unsigned long number, unsigned intbase,
char * string, size_t maxlgh)
{
/* assert (string[maxlgh]) is valid storage */
if (!maxlgh) {
*string = '\0';
return;
}
else {
*string = tio_hexify(number %base);
if (!number) *string = '\0';
else {
tio_basedisplay(number /base,base, &string[1], maxlgh -
1);
}
}

} /* tio_basedisplay */

/* ======================= */
/* reverse string in place */
void tio_revstring(char * string)
{
char * last, temp;

last = string + strlen(string); /* points to '\0' */
while (last-- string) {
temp = *string; *string++ = *last; *last = temp;
}

} /* tio_revstring */

And the header file:

#ifndef dispbase_h_
#define dispbase_h_

#include <string.h>

/* ============================================ */
/* Mask and convert digit to hex representation */
/* Output range is 0..9 and a..f only */
int tio_hexify(unsigned int value);

/* ========================================= */
/* convert number to string in various bases */
/* 2 <=base<= 16, controlled by hexify() */
/* Output string has ls digit first. */
void tio_basedisplay(unsigned long number, unsigned intbase,
char * string, size_t maxlgh);

/* ======================= */
/* reverse string in place */
void tio_revstring(char * string);

#endif

--
<http://www.cs.auckland.ac.nz/~pgut001/pubs/vista_cost.txt>
<http://www.securityfocus.com/columnists/423>

"A man who is right every time is not likely to do very much."
-- Francis Crick, co-discover of DNA
"There is nothing more amazing than stupidity in action."
-- Thomas Matthews
I am sorry about that are some bugs on this programe that the complier
can not run it in DVE-C++.
Since I am not sure understand the errors, I can not correct them all
by following the instructions.

Mar 5 '07 #9
jy****@gmail.com said:

<snip>
I am sorry about that are some bugs on this programe that the complier
can not run it in DVE-C++.
Since I am not sure understand the errors, I can not correct them all
by following the instructions.
It works fine here, once supplied with a driver.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
Mar 5 '07 #10
Richard Heathfield wrote:
jy****@gmail.com said:

<snip>
>I am sorry about that are some bugs on this programe that the complier
can not run it in DVE-C++.
Since I am not sure understand the errors, I can not correct them all
by following the instructions.

It works fine here, once supplied with a driver.
It's old code of mine, and has two known faults. Dependence on
Ascii, in hexify. Undefined behaviour in reverse_str on empty
string. Both unlikely to bother the OP, and fairly easily
corrected.

--
<http://www.cs.auckland.ac.nz/~pgut001/pubs/vista_cost.txt>
<http://www.securityfocus.com/columnists/423>

"A man who is right every time is not likely to do very much."
-- Francis Crick, co-discover of DNA
"There is nothing more amazing than stupidity in action."
-- Thomas Matthews
Mar 5 '07 #11
CBFalconer said:
Richard Heathfield wrote:
>jy****@gmail.com said:

<snip>
>>I am sorry about that are some bugs on this programe that the
complier can not run it in DVE-C++.
Since I am not sure understand the errors, I can not correct them
all by following the instructions.

It works fine here, once supplied with a driver.

It's old code of mine, and has two known faults. Dependence on
Ascii, in hexify.
Trivially fixed:

int tio_hexify(unsigned int value)
{
return "0123456789ABCDEF"[value & 0x0f];
} /* tio_hexify */
Undefined behaviour in reverse_str on empty
string.
Again, trivially fixed:

void tio_revstring(char * string)
{
char * last, temp;

last = string + strlen(string); /* points to '\0' */
while (last string) {
temp = *string; *string++ = *--last; *last = temp;
}
} /* tio_revstring */

Both unlikely to bother the OP, and fairly easily corrected.
Aye.
--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
Mar 5 '07 #12

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

Similar topics

2
by: Christian Engström | last post by:
When I compile the below program with Microsoft Visual C++ version 6, I get the results I expect, which is that the program should write out base() derived() base() derived(derived) When I...
6
by: Ryan Mitchley | last post by:
Hi all Given bool bResult; shared_ptr<cSampleData> pNewData; shared_ptr<cBase> pNewBase; where cSampleData is descended from cBase, the following gives me a valid pNewData to the correct...
6
by: Tony Tortora | last post by:
I am writing and add on application. The application uses Unique IDs and they are stored in Base 26 (ie 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ). I am having trouble reading the decimal value of a...
1
by: Mark McDonald | last post by:
This question kind of follows on from Mike Spass’ posting 10/11/2004; I don’t understand why you can’t declare an implicit operator to convert a base class to a derived class. The text...
10
by: Andrzej Kaczmarczyk | last post by:
Hi C# gurus :) I have a conversion problem. I have a class that I can't change - it's a DataColumn class; I have a wrapper class around it. public MyDataColumn : DataColumn {
6
by: Taran | last post by:
Hi All, I tried something with the C++ I know and some things just seem strange. consider: #include <iostream> using namespace std;
10
by: Angel Tsankov | last post by:
Hello! Is the following code illformed or does it yield undefined behaviour: class a {}; class b {
19
by: jan.loucka | last post by:
Hi, We're building a mapping application and inside we're using open source dll called MapServer. This dll uses object model that has quite a few classes. In our app we however need to little bit...
3
by: jared.grubb | last post by:
Can a private Base class method convert to/from a Derived* using static_cast? The CPL book says that a Derived method is allowed to convert to/from Base, but says nothing about whether a Base...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
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,...

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.