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

The Archive Base Latest Questions

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

Friends I want to integrate the following code into the main application code. The

  • 0

Friends

I want to integrate the following code into the main application code. The junk characters that come populated with the o/p string dumps the application The following code snipette doesnt work..

void stringCheck(char*);  int main() {     char some_str[] = 'Common Application FE LBS Serverr is down';     stringCheck(some_str); }   void stringCheck(char * newString) {     for(int i=0;i<strlen(newString);i++)     {         if ((int)newString[i] >128)         {  TRACE(' JUNK Characters in  Application Error message FROM DCE IS = '<<(char)newString[i]<<'++++++'<<(int)newString[i]);          }     } } 

Can someone please show me the better approaches to find junk characters in a string..

Many Thanks

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

    Your char probably is represented signed. Cast it to unsigned char instead to avoid that it becomes a negative integer when casting to int:

    if ((unsigned char)newString[i] >128) 

    Depending on your needs, isprint might do a better job, checking for a printable character, including space:

    if (!isprint((unsigned char)newString[i]))      ... 

    Note that you have to cast to unsigned char: input for isprint requires values between 0 and UCHAR_MAX as character values.

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

Sidebar

Related Questions

i am creating a music application and i want to integrate facebook into my
I have a database table that i want to allow my friends to update.
friends, i want to set layout_marginBottom using java code or dynamically in list view
In a python based facebook application on GAE, i want to check which friends
I talked to a few friends who say that Drupal is amazing, and it
We have a social site, and want to integrate facebook connect to save time
Which is the greatest, cheapest application in PHP that I can buy to import
I want my peers or family friends to test my apps for feedback before
friends I am new in game development programing .And I want to understand the
Hi friends I have created newsletter system. In which I want to send person

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.