CoolInterview.com - World's Largest Collection of Interview Questions & Answers, FAQs, queries, sample papers, exam papers, dumps, what, why, how, where, when questions
Interview Success Kit - Get Success in Job Interviews Interview Success Kit - 30,000 Interview Que. & Ans.
Covers 30,000+ Interview Questions asked in actual MNC Interviews - all with model answers.

Sponsored Links

Interview Questions
Our Services

INTERVIEW QUESTIONS PROGRAMMING LANGUAGES C++ DETAILS
Question :
Write a fucntion that will reverse a string.

Category C++ Interview Questions
Rating (4.5) By 24 users
Added on 7/16/2015
Views 42
Rate it!


Answers:

Source: CoolInterview.com

char *strrev(char *s)
{
int i = 0, len = strlen(s);
char *str;
if ((str = (char *)malloc(len+1)) == NULL)
/*cannot allocate memory */
err_num = 2;
return (str);
}
while(len)
str[i++]=s[?len];
str[i] = NULL;
return (str);
}
Source: CoolInterview.com



If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-

  • There should not be any Spelling Mistakes.
  • There should not be any Gramatical Errors.
  • Answers must not contain any bad words.
  • Answers should not be the repeat of same answer, already approved.
  • Answer should be complete in itself.
  • Name :*
    Email Id :*
    Answer :*
    Verification Code Code Image - Please contact webmaster if you have problems seeing this image code Not readable? Load New Code
    Process Verification Enter the above shown code: *
    Inform me about updated answers to this question

    Related Questions
    View Answer
    What is the difference between Stack and Queue?
    View Answer
    What are the differences between new and malloc?
    View Answer
    What is your reaction to this line of code?
    View Answer
    When should you use multiple inheritance?
    View Answer
    What are the debugging methods you use when came across a problem?
    View Answer
    How the compilers arranges the various sections in the executable image?
    View Answer
    What are the differences between a C++ struct and C++ class?
    View Answer
    How do you know that your class needs a virtual destructor?
    View Answer
    What is the difference between new/delete and malloc/free?
    View Answer
    What happens when a function throws an exception that was not specified by an exception specification for this function?
    View Answer
    Can you think of a situation where your program would crash without reaching the breakball, which you set at the beginning of main()?
    View Answer
    What issue do auto_ptr objects address?
    View Answer
    Is there any problem with the following:
    View Answer
    Why do C++ compilers need name mangling?
    View Answer
    Is there anything you can do in C++ that you cannot do in C?


    View Answer
    What is problem with Runtime type identification?
    View Answer
    What is Pure Virtual Function? Why and when it is used ?
    View Answer
    What about Virtual Destructor?
    View Answer
    Is it possible to have Virtual Constructor? If yes, how? If not, Why not possible ?
    View Answer

    Please Note: We keep on updating better answers to this site. In case you are looking for Jobs, Pls Click Here Vyoms.com - Best Freshers & Experienced Jobs Website.

    View ALL C++ Interview Questions & Answers

    User Options
    India News Network

    Latest 20 Questions
    What is Financial Analysis Auditing Compliance Tracking System (FACTS) in Futures and Options Trading Market?
    What is Fill-or-Kill in Futures and Options Trading Market?
    What is Feed Ratio in Futures and Options Trading Market?
    What is Federal Reserve System in Futures and Options Trading Market?
    What is Federal Housing Administration (FHA) in Futures and Options Trading Market?
    What is Federal Fund Rate in Futures and Options Trading Market?
    What is Federal Fund in Futures and Options Trading Market?
    What is Expiration Time in Futures and Options Trading Market?
    What is Expiration Date in Futures and Options Trading Market?
    What is Expiration Cycle in Futures and Options Trading Market?
    What is Expanded Traded Hour in Futures and Options Trading Market?
    What is Exercise Settlement Amount in Futures and Options Trading Market?
    What is Exercise in Futures and Options Trading Market?
    What is Exchange for Physicals in Futures and Options Trading Market?
    What is European-Style Option in Futures and Options Trading Market?
    What is European Term in Futures and Options Trading Market?
    What are Equity Options in Futures and Options Trading Market?
    What is Equilibrium Price in Futures and Options Trading Market?
    What is Econometrics in Futures and Options Trading Market?
    State the Charges and Fees payable for Housing loan?



    Fresher Jobs | Experienced Jobs | Government Jobs | Walkin Jobs | Company Profiles | Interview Questions | Placement Papers | Companies In India | Consultants In India | Colleges In India | Exams In India | Latest Results | Notifications In India | Call Centers In India | Training Institutes In India | Job Communities In India | Courses In India | Jobs by Keyskills | Jobs by Functional Areas

    Testing Articles | Testing Books | Testing Certifications | Testing FAQs | Testing Downloads | Testing Interview Questions | Testing Jobs | Testing Training Institutes

    Gate Articles | Gate Books | Gate Colleges | Gate Downloads | Gate Faqs | Gate Jobs | Gate News | Gate Sample Papers | Gate Training Institutes

    MBA Articles | MBA Books | MBA Case Studies | MBA Business Schools | MBA Current Affairs | MBA Downloads | MBA Events | MBA Notifications | MBA FAQs | MBA Jobs
    MBA Job Consultants | MBA News | MBA Results | MBA Courses | MBA Sample Papers | MBA Interview Questions | MBA Training Institutes

    GRE Articles | GRE Books | GRE Colleges | GRE Downloads | GRE Events | GRE FAQs | GRE News | GRE Training Institutes | GRE Sample Papers

    IAS Articles | IAS Books | IAS Current Affairs | IAS Downloads | IAS Events | IAS FAQs | IAS News | IAS Notifications | IAS UPSC Jobs | IAS Previous Question Papers
    IAS Results | IAS Sample Papers | IAS Interview Questions | IAS Training Institutes | IAS Toppers Interview

    SAP Articles | SAP Books | SAP Certifications | SAP Companies | SAP Study Materials | SAP Events | SAP FAQs | SAP Jobs | SAP Job Consultants
    SAP Links | SAP News | SAP Sample Papers | SAP Interview Questions | SAP Training Institutes |




    Copyright ©2003-2016 CoolInterview.com, All Rights Reserved.
    Privacy Policy | Terms and Conditions



    Cache = 0 Seconds