Quantcast

A community for students. Sign up today!

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

sahil.sharad

  • 2 years ago

can somebody pls tell me the method to get a string from user and then print the string entered by the user also to do any kind of manipulation or operations in it by using for loop or any other loop method and also i dont want to use gets for getting the string???

  • This Question is Open
  1. shadowfiend
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 1

    Are you using C? Why don't you want to use gets? You can also use getc I suppose.

  2. agdgdgdgwngo
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 2

    you can use fgets (with stdin as the FILE*) as an alternative to gets. If you don't want to use anything like fgets or scanf, you can use getchar :-D

  3. sahil.sharad
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    now i just wanna use scanf but that is not a big problem the problem is how will i manipulate that string incase i have to do any operation on it...for example let me give u a programme and u tell me the coding 1.)MAKE A PROGRAMME TO GET A STRING FROM A USER (NOT USING GETS) AND REPLACE ALL THE "A" AND "B" IN THE STRING BY "?"(QUESTIONMARK) YES U HAVE TO MAKE IT IN C

  4. agdgdgdgwngo
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 2

    http://ideone.com/87Wdm

  5. annas
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    you can use an array for that purpose and a for loop

  6. Not the answer you are looking for?
    Search for more explanations.

    Search OpenStudy
    • Attachments:

Ask your own question

Ask a Question
Find more explanations on OpenStudy

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.