Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8158843
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T17:44:34+00:00 2026-06-06T17:44:34+00:00

I had asked a question very much similar to this in the thread: https://stackoverflow.com/questions/11259474/store-the-numericals-in-char-array-into-an-integer-variable-in-vc

  • 0

I had asked a question very much similar to this in the thread:
https://stackoverflow.com/questions/11259474/store-the-numericals-in-char-array-into-an-integer-variable-in-vc

W.R.T. the above thread, my question is as follows:: I am working in UNICODE environment. So TCHAr would probably be treated as wchar.

My scenario is as follows:(C++)

In TCHAR a[10], the array a[] has elements (numbers) like
‘1’,’2′,’3′ etc….

Say a[0] = ‘1’; a1 = ‘2’; a[2] = ‘3’;

Now a[] is storing 3 characters ‘1’, ‘2’ and ‘3’. I want to store this
into an int as 123 (An integer 123).

How to achieve this in C++ ?

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T17:44:36+00:00Added an answer on June 6, 2026 at 5:44 pm

    First, you have to null-terminate your string. Otherwise, how do you know where to stop? Then there’s a function _ttoi() specifically for that.

    a[3] = 0;
    int n = _ttoi[a];
    

    You have to understand the null termination bit. Depending on how do you fill the a with characters (digits), the logic of determining the end of the string might vary.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I had asked a question similar to this before, but I have a new
I had asked this question Adding more attributes to LINQ to SQL entity Now,
This is a link to a question I had asked two days back, How
I know this question had been asked a hundred times, but I have difficulties
I know that this question had already been asked a couple of times before,
This question may have been asked before, but I had trouble finding an answer,
I had this question asked of me on Monday and for the life of
I had asked this question before, but I got no correct answer. So, this
I asked a very similar question and I approved an answer as I thought
This question HAS had to be asked before, so it kills me to ask

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.