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 6743899
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:01:10+00:00 2026-05-26T12:01:10+00:00

for example I have a c++ which takes 2 integers from a file. For

  • 0

for example I have a c++ which takes 2 integers from a file. For example int a = 2052342 and int b = 2. I need to do a search that will search if b is inside a. So in this example, b is inside a, but if b would be for example 7 it wouldn’t be. What kind of function, should I use, and could you give me a quick demo of it?
Edit: No it’s not a homework, I will compete in Programmers Olympiad this year, so I’m programming all of the C++ exercises that were in last Programmers Olympiads.

  • 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-05-26T12:01:11+00:00Added an answer on May 26, 2026 at 12:01 pm

    You use a pretty flakey example without much explanation of what “if b is inside a’ means. Are you just checking to see if the substring of ‘int b’ is inside ‘int a’? if B were 205, or 234, would that count?

    Perhaps not the best way, but simple enough, is to convert each integer to a string, and then do a substring check to see if stringB is a substring of stringA.

    Update: Infact, when you’re parsing your file, i’d just read them in as string, don’t even look at this as a problem of integers. You’re just doing substring checks. Also, if you parse them as integers, you’d run in to 0-padding being lost.

    If you’re talking about division or something else, that could be done by doing division.

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

Sidebar

Related Questions

Example: I have a selector like this, which I give to another method as
For example, I have a struct which is something like this: struct Test {
I have implemented a function TraverseStringClockwise which takes a comma separated string of integers,
Good day, If I have for example the documents which have the following fields
For example,We have a DWORD = $12345678 Which of the instructions would be faster
for example: I have app A, which references library A and library B. in
Does anyone have an example AUTORUN.INF which can launch an MSI installer automatically when
I have a URL which can be any of the following formats: http://example.com https://example.com
I have a page which expects a numeric query string value. For example: Details.aspx?rgn=1234
I have a table which defines what things another table can have, for example:

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.