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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T13:03:08+00:00 2026-06-08T13:03:08+00:00

Given a global vector list of ASCII codes and corresponding number values and a

  • 0

Given a global vector list of ASCII codes and corresponding number values and a string, like 000.00-000.0.0.0, this function takes an input token strings 2-char or 3-char long and replaces it with a single ASCII symbol that represents the number value between 0 and 184, then returns the shortened string without deliminator as out. Also, in reverse (direction 1) given the ASCII symbol it converts back to the number string and returns.

//looks for input string in vector and returns output, 'c' is check row, 'r' is return row
string vectorSearch(string &check, int n, int c, int r) 
{
    if (check.length() <= 1) 
        return check;
    if (list[n][c] == check || list[n][c] == ('0'+check)) //adds leading zero if 2char long
        return list[n][r];
    else 
        return vectorSearch (check, ++n, c, r);
}

//this function takes an ontology and either changes from single char 
//to string or takes strings and converts to char representation
string Lexicon::convertOntology(string input, int direction, string out, string temp) 
{
    if (input == "" && temp == "") 
        return out; //check for completed conversion
    else {
        if (input[0] == '.' || input[0] == '-' || input == "") { //found deliniator or endk
            if (input != "") return convertOntology(input.substr(1),direction, 
                 out+=vectorSearch(temp, 0, direction, 1-direction), "");
            else return convertOntology("", direction, 
                 out+=vectorSearch(temp, 0, direction, 1-direction), "");
        } else 
            return convertOntology(input.substr(1), direction, out, temp+=input[0]); //increment and check
    }
}

These functions work fine except for on output after the last char is parsed. With a break on the line return convertOntology(input.substr(1), direction, out+=add, temp); there is an error when input == "" and temp == "0" – the last pass through vectorSearch() should clear the temp and add the temp char to the out string, since the temp is == 1char then it should be returned from vectorSearch() as it is. Then clear the convertOntology() return check of input and temp == "". But, it never reaches a break on the first line of vectorSearch() and there is an

Unhandled exception at 0x77bc15de exception: std::out_of_range at memory location 0x0035cf1c

What is going on? Is this an issue with recursion backtracking through returns and I am missing a return somewhere to break the recursion loop?

  • 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-08T13:03:09+00:00Added an answer on June 8, 2026 at 1:03 pm

    for the case where temp == "" and input != "" you call input.substr(1) which is, well, out of range.

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

Sidebar

Related Questions

Given the following code snippet: $i= 11; function get_num() { global $i; return (--$i
Given this source document: <?xml version=1.0 encoding=utf-8?> <config> <group name=global> <globals> <item grp=db prop=userid
Function manageFirstList should recursively copy one element at the time to global list x.
I'm playing around with the Visual Studio 11 Beta. Given this code: namespace KC.DataAccess.Global
I define routes in my global.asax, like this: routes.MapRoute( Default, {controller}/{action}/{id}, new { controller
Given this code: function Test(){ var $D = Date.prototype; $D.addDays=function(value){this.setDate(this.getDate()+value);return this;}; $D.clone = function()
Given the following xaml code, I would like to create this xaml code the
Given this Global.asax.cs: using System; using System.Web; namespace Foo.Web { public class Global :
Given a string (as seen in the examples below), I would like to extract
Given that the web application doesn't have su privileges, I'd like to execute a

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.