how to directly convert char to numbers?

Let’s learn how to directly convert char to numbers. The most accurate or helpful solution is served by Stack Overflow.

There are ten answers to this question.

Best solution

How to convert a 2d char array to a 2d int array?

char puzzle[i][j]; int i,j,count=0; char value[81]; for( i = 0; i < 9; i++){ for( j = 0; j < 9; j++){ cin >> value[count]; puzzle[i][j] = value[count]; count++; }} This what I have so far. I tried using atoi but I needed a char * str. The input is: ..4545.. (numbers and periods) I'm trying to convert the char puzzle[i][j] to an int puzzle[i][j]. The char array currently holds "..4545.." and I want to covert it so it holds just integers "00454500".

Answer:

Engaging psychic debugger... Performing Jedi mind tricks... This is the code you want: int puzzle[9...

Read more

Phil at Stack Overflow Mark as irrelevant Undo

Other solutions

C++ please help.. Asking Again..Right Heree.. Palindromic Numbers?

I already write a Palindromic Number codes and I showed my teacher. The teacher said you need to rewrite your codes again and wants to puts these expressions.. The program must be split into the following functions. So, the following codes are my original...

Answer:

If you're using c++, you're ,making your life complicated for no reason. #include <iostream> ...

Read more

Lebron at Yahoo! Answers Mark as irrelevant Undo

Palindromic Numbers Please hElp C++?

My new version codes are supposed to include these expressions and I dont know what to do// bool ispalindrome(char[]); Palindromic number equals itself when its digits are reversed. Examples: 101, 2112, 12321. bool isrepdigit(char[]); The digits of a...

Answer:

I'm not exactly sure what it is you are asking... What is it that you don't understand? Based on what...

Read more

Lebron at Yahoo! Answers Mark as irrelevant Undo

Cannot convert 'char far*' to 'const char *'?

Basically what I'm trying to do is to compile a PCX loader and I can't seem to get around this error. Here is the full code of this thing: #include <stdio.h> #include <dos.h> #include <io.h> #include <fcntl.h> #include <mem...

Answer:

I don't know what a far is, but here is how you convert: void myfunc(void *a) { char *c = (char *) a...

Read more

Doomguy at Yahoo! Answers Mark as irrelevant Undo

C++ convert char * to char?

I've been trying to applying conditions so a users input so they should input a number followed by a letter i then extract and save both the number and letter section these have to by saved as char * types to use the cin.getline() i then need to convert...

Answer:

You can de-reference the pointer! Try using it like this: if ( letter == *cptr) // where cptr is the...

Read more

David at Yahoo! Answers Mark as irrelevant Undo

C++ how to convert a float to char?

How to convert a float to char in C++ : i wanna convert fVal = 65 to become char* cVal = "65" and NOT 'A' I tried itoa() but it converts only integers besides that ...show more

Answer:

I got this problem When I was "developing" a small Direct3D application. Im using D3DXCreateFont...

Read more

46U2UFSB7MLWM6LWRRAAWAZ63Q at Yahoo! Answers Mark as irrelevant Undo

Convert decimal numerals to hexadecimal:char c(int k) ?

this is how far i got i seriously need help char c(int k) { assert (k >= 0 && k <= 15); if (k < 10) return char(k + '0'); return char(k - 10 + 'a'); } string s(int n) { if (n == 0) return string(1,'0'); string s; while (n > 0) { s...

Answer:

You're completely wrong, your code makes no sense. Read the textbook.

Read more

hoda a at Yahoo! Answers Mark as irrelevant Undo

Convert an char array to one float value?

hi i have any array of chararctaers that reresent a speed for example char a[3]={0,.,9} i want to convert this array to a float value .. that is float b=0.9 i havea function that convert an array with only number to an integer value i cant find any that...

Answer:

It would help greatly if you tell us which language you are programming in (I will update my answer...

Read more

Fatima at Yahoo! Answers Mark as irrelevant Undo

How do I fix my C program to Convert numbers to Roman numerals?

Having trouble printing the numbers 900, 500 and much more. It gives me the wrong roman numerals. source code: #include <stdio.h> #include <stdlib.h> #include <string.h> int main(){ int i, n; char str[4]; char roman[20]=""...

Answer:

Basically because your maths is wrong! You correctly handle the thousands but then start going wrong...

Read more

Nicholas at Yahoo! Answers Mark as irrelevant Undo

How i convert 0.00425 ..numbers into 1/235 numbers ???

i want to convert this tipe of numbers.... 0.000235... 0.0147... 0.06587.. etc,, (just examples) into 1/1023 .... 1/325.... 1/475 etc (just examples) i need the formula please.. =)

Answer:

ok, what i'd do is multiply .00425 by 100000 which would give u 425then divide than 100000 so basically...

Read more

Punk_Rck... at Yahoo! Answers Mark as irrelevant Undo

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.