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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:20:38+00:00 2026-06-18T01:20:38+00:00

I have a code that i have to replace few special chars: code below:

  • 0

I have a code that i have to replace few special chars:
code below:

#include <iostream>\012#include <stdio.h>\012#include <stdlib.h>\012#include <limits>\012#include <string.h>\012using namespace std;\012\012void inclean(){\012\011std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\\n');\012}\012\012void die(string e){\012\011//cout << e;\012\011exit(1);\012}\012\012typedef struct {\012\011bool zajente;\012\011int rozmiar;\012} pudelko;\012\012int main() {\012\011int i = 12;\012setvbuf(stdout, NULL, _IONBF, 0);\012\011setvbuf(stderr, NULL, _IONBF, 0);\012\011int a;\012\011int lamount=0;\012\011cin >> a;\012\011if(!(a>=1&&a<=1000000)){die("Liczba mo\277e wynosi\346 od 1 do 1000000(10^6)");}\012\011pudelko  *pudelka=new pudelko[a];\012\011memset (pudelka,0,a*sizeof(pudelko));\012\011string b;\012\011inclean();\012\011getline(cin,b);\012\011int bl=b.length();\012\011for(int i=0;i<=bl;i++){\012\011\011char c=b.c_str()[i];\012\011\011if (c>=48&&c<=57){\012\011\011\011pudelka[lamount].rozmiar*=10;\012\011\011\011pudelka[lamount].rozmiar+=(int)c-48;\012\011\011\011pudelka[lamount].zajente=false;\012\011\011} else {\012\011\011\011if(!(pudelka[lamount].rozmiar>=1&&pudelka[lamount].rozmiar<=1000000000)) die("Liczba mo\277e wynosi\346 od 1 do 1000000000(10^9)");\012\011\011\011lamount++;\012\011\011\011if(lamount>=a) break;\012\011\011}\012\011}\012\011int cpa=lamount;\012\011int e=0;\012\011while (true){\012\011\011for(int z=e;z<=cpa;z++)\012\011\011\011if(pudelka[z].rozmiar>pudelka[e].rozmiar&&!pudelka[z].zajente){\012\011\011\011\011pudelka[z].zajente=true;\012\011\011\011\011lamount--; break;\012\011\011\011}\012\011\011if(e>=cpa){ cout << "" << lamount+1; break; }\012\011\011e++;\012\011\011}\012\011exit(0);\012\011return(0);\012}\012

what i tried to remove \012 and \011 was

 $this->data['StoredFile']['data'] = str_replace("\012","\n",$this->data['StoredFile']['data']);
 $this->data['StoredFile']['data'] = str_replace("\011","\t",$this->data['StoredFile']['data']);

Also used

$this->data['StoredFile']['data'] = stripslashes($this->data['StoredFile']['data']);

wchich removed \0 and then by str_replace i removed 11 and 12… but i noticed that for e.x. int i = 12; was changed to int i = \n; what i dont wont to happen ;<

  • 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-18T01:20:39+00:00Added an answer on June 18, 2026 at 1:20 am

    Use str_ireplace.

    $output = str_ireplace (array('\012','\011'),array("\n","\t"), $string);
    

    DEMO.

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

Sidebar

Related Questions

I have code that generates a List<string[]> variable but can't quite figure out how
I have code that looks more or less like the code below but it
Below I have a segment of my code that I recently added to my
I have to write some sort of parser that get a String and replace
I have a function that finds a regex thingy, then replaces with php code.
I have code that sends web requests through two parallel for each loops. Will
I have code that reloads images via HTTP from the main thread and displays
I have code that looks like this: obj.foo(); // obj might, or might not
I have code that looks like this: template<class T> class list { public: class
I have code that I want to look like this: List<Type> Os; ... foreach

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.