1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

文字列「8951」速く来いを整数に変換して遊ぶ

Posted at

x 過去ログを見よ!!!
x M5NanoC6での予定は、未定
x ポケベルメッセージ

オンラインコンパイラ


#include <iostream>
using namespace std;
int main(void){
    // Your code here!
    char *a = "8951";
    int b;
    
    b = (a[0]-'0')*1000+(a[1]-'0')*100+(a[2]-'0')*10+(a[3]-'0');
    
    printf("b = %d\n",b);
    
}


b = 8951

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?