• Ask Question
  • Propose Category
  • Interview eBook
  • Geek Forums
  • Online Learning
  • Online Quiz
  • Site Updates
  • User Login
    • Login



      Lost Password
      Click here to get activation email.

  • 07-05-2025
GeekInterview.com
  • Interview Questions
    • Fundamentals
      • Concepts
      • General
      • Management
      • Accounting
    • Operating System
      • Operating System
      • Android
      • iOS
      • Microsoft
    • Coding
      • Programming
      • J2EE
      • Languages
    • Database
      • Database
      • Data Warehousing
      • Oracle
    • Applications
      • Applications
      • Clarify CRM
      • Oracle Apps
      • Peoplesoft
      • Siebel
    • Software Testing
      • Testing
      • Testing Tools
    • Miscelleanous
      • Helpdesk
      • Mainframe
      • Networking
      • SAP R/3
      • Web
  • Interview Coaching
    • Career Counseling
    • Job Interview
  • Interview eBooks
    • Accounting eBook
    • C eBook
    • Citrix eBook
    • Job Interview eBook
  • Career Advice
    • Career Change
    • Jobs Help
    • Projects
    • Requests
    • Resume Help
    • Training Advice
  • Engineering
    • Chemical Engineering
    • Civil Engineering
    • Electrical Engineering
    • Electronics Engineering
    • Micro Processor
    • Mechanical Engineering
  • By Company
  • Ask Question
  • Home
  • dhana80s Questions

Submitted Questions

  • Aug 28 2006
    02:04 PM

    2099
    5

    strcat(buf,buf);

    printf(buf);

    }


    While executing this in VC++ I do not get an output . Looks like the program runs into an infinite loop. But while executing the same in Turbo C I get the output as "hellohelloh". What could be the reason behind this difference in output?">

    Consider the following program segment :#include #include void main () { char buf[100] = "hello"; strcat(buf,buf); printf(buf);}While executing this in VC++ I do not get an output . Looks like the program runs into an infinite loop. But while executing the same in Turbo C I get the output as "hellohelloh". What could be the reason behind this difference in output?

    • dhana80s

    jbode

    profile Profileanswers Answers by jbodequestions Questions by jbode

    • Jul 6th, 2010

    As kbjarneson pointed out, the problem is that you are clobbering the 0 terminator of the input string; once that happens, strcat() doesn't know where to stop.  His solution is to use memmove...

    kbjarnason

    profile Profileanswers Answers by kbjarnasonquestions Questions by kbjarnason

    • Jul 2nd, 2010

    Consider how strcat might be written:strcat( char *dst, char *src ){   /* Find end of string */   while ( *dst )        dst++;   while ...

    Answer Question  Select Best Answer

Subscribe To RSS Feed

Tags Cloud

Company Interviews
  • Accenture (52)
    • Aptitude Interview Questions
    • Group Discussions Topics
    • Placement Assistance
  • Adobe (7)
    • Placement Assistance
  • AMD (1)
    • Placement Assistance
  • AMDOC (2)
    • Placement Assistance
  • Axes-Technologies (25)
    • Computer Awareness Questions
  • Aztec-Systems (15)
    • Aptitude Interview Questions
    • C Interview Questions
  • BirlaSoft (26)
    • Languages Interview Questions
  • Cisco (35)
    • Micro Processor Interview Questions
  • Cognizant (1)
    • Placement Assistance
  • Dell (22)
    • Aptitude Interview Questions
  • GE (2)
    • Placement Assistance
  • HAL (1)
    • Placement Assistance
  • Infosys (212)
    • Challenging Puzzles
  • ISRO (6)
    • Placement Assistance
  • Mphasis (1)
    • Placement Assistance
  • Oracle (206)
    • Aptitude Interview Questions
    • Java Interview Questions
    • SQL Interview Questions
  • Sonata (65)
    • Analytical Ability Interview Questions
    • C Interview Questions
  • TCS (396)
    • Aptitude Interview Questions
    • C FAQs
    • COBOL Interview Questions
    • Critical Reasoning Questions
    • Quantitative Aptitude Questions
  • Wipro (217)
    • Analytical Ability Interview Questions
    • Languages Interview Questions
    • Verbal Ability Questions

Interview Questions PDF Files

Accounting Interview Questions PDF
Citrix Interview Questions PDF
Best Questions and Answers From C PDF
Job Interview Questions and Answers PDF
Oracle Apps Technical Interview Questions and Answers PDF
Siebel Interview Questions PDF

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.

Latest News

Tags

AccentureWiproAMDAMDOCAxes-TechnologiesAztec-SystemsBirlaSoftCiscoCognizantDellGEHALInfosysISROTCSSonataAdobeOracleMphasis

Contact Us

Geekinterview.com

  • About US
  • Privacy Policy
  • Terms & Conditions
  • DMCA
  • Contact Us

© Copyright 2014-2025 GeekInterview.com | All Rights Reserved


 

It looks like you are using an AD Blocker!

 

 

Please Turn OFF your ad blocker

- OR -

LOGIN to continue using GeekInterview website.

 

 

 

Disable
Ad Blocker

 

Learn More

Login
GeekInterview

 

Login

Create your
GeekInterview account

 

Signup

Continue Reading after Disabling

 

Refresh