Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

 
 
Thread Tools Display Modes
Prev Previous Post in Thread   Next Post in Thread Next
Old Mar 30th, 2008, 1:12 PM   #1
Marijan
Newbie
 
Join Date: Feb 2008
Posts: 15
Rep Power: 0 Marijan is on a distinguished road
Got stuck while making a program,help would be appreciated

I decided to make a program that would change the inserted text according to this pattern:Replacing every letter with the next one in the alphabet.For example:
"Cat"- "Dbu".
I started and it went well up untill a point,my code looks like this so far:
c++ Syntax (Toggle Plain Text)
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. void Funkcija1(string zbor)
  6. {
  7. char x;
  8. zbor[x];
  9. for(x=0;x<100;x++)
  10. {
  11. if(zbor[x]=='a')
  12. zbor[x]='b';
  13. }
  14.  
  15. cout<<zbor<<endl;
  16.  
  17. }
  18.  
  19. int main()
  20.  
  21. {
  22. string Vs;
  23. cin>>Vs;
  24. Funkcija1(Vs);
  25.  
  26. system("PAUSE");
  27.  
  28. return EXIT_SUCCESS;
  29.  
  30. }

It seemed to work well,but when i tried to make the program to replace the letter "B" with "C",it replaced the allready replaced letter "B".I am a tottal begginer in C++ and with no experience in other programming languages so far.
I found help some time ago here on another question,i sincerely hope that you guys will be helpfull again.
Marijan is offline   Reply With Quote
 

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help. I got a problem in making Java games .. bratsercom Java 11 Oct 1st, 2007 3:31 PM
C++ Getting stuck within a loop. n3o_X C++ 5 Aug 29th, 2007 3:03 PM
Tutorials for making a P2P program? Palladio C++ 3 Nov 26th, 2005 4:51 AM
Multiple http-requests are stuck MereMortal C++ 0 May 4th, 2005 4:08 AM
Making a Note Adder/ Editor/ Deleter/ Viewer thingy brokenhope C++ 19 Apr 29th, 2005 2:30 AM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 10:34 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC