Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Computer Forums > Programmers Lounge > Programming Discussions » for (int f = 0; szInput[f] !='@'; f++)
Closed Thread
Old 07-17-2006, 11:09 PM   #11 (permalink)
 
True Techie

Join Date: May 2006

Posts: 101

jonmon6691

Default

dam* i should've seen that! Thanks
__________________
<small>
.:HP Pavillion dv6000:.
1.8 ghtz Intel Core 2 Duo
2GB RAM
120 GB HDD
nVidia Go graphics
Apache 2.2 (looking for a domain name)
</small>
jonmon6691 is offline  
Old 07-17-2006, 11:10 PM   #12 (permalink)
 
True Techie

Join Date: May 2006

Posts: 101

jonmon6691

Default

all right thanks to everyone that helped.

Code:
#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
      //Main variables intalized here
      int disp=0;
      int f = 0;
      int ii = 0;
      char szInput[128];
      char cAlpha[] = {" abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWX
YZ"};
      int  nIndex[] =  {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,2
 0,21,22,23,24,25,26,1,2,3,4,5,6,7,8,9,10,11,12,13,
14,15,16,17,18,19,20,21,22,23,24,25,26};
      int  ninputindex[128];
      //Beyond here is the program
      cout << ">:";
      cin >> szInput;

      for (; szInput[f] != '\0'; f++)
      {
          ii=0;
          //cout << "\nloop    1: " << f;
          for (;ii<53;ii++)
          {
              //cout << "\nloop  2: " << ii;
              if (szInput[f] == cAlpha[ii])
              {
                 ninputindex[f]=nIndex[ii];
              }
          }
      }
      int j = f ;
      for (;j > 0;j--)
      {

          cout << ninputindex[disp] << " ";
          disp++;
      }

      system("PAUSE");
      return 0;

__________________
<small>
.:HP Pavillion dv6000:.
1.8 ghtz Intel Core 2 Duo
2GB RAM
120 GB HDD
nVidia Go graphics
Apache 2.2 (looking for a domain name)
</small>
jonmon6691 is offline  
 
Closed Thread

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
Trackbacks are On
Pingbacks are On
Refbacks are On