Click here to Skip to main content
16,020,984 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
C++
#include "stdafx.h"
#include "stdafx.h"
#include <iostream>
#include <string>
using namespace std;
int jomleTokalame(string *a,string c,int count){
 string cc="";
 count =0;
 for(int i = 0 ; c[i]!='\0';i++){
  cc+=c[i];
  if (c[i]==' ' || c[i+1]=='\0'){
   a[count]=cc;
   count++;
   cc="";
  }
 }
 //tedade kalamat ro mide
 return count;
}
int _tmain(int argc, _TCHAR* argv[])
{
 int location[100];
 string str[100];
 string a;
 string s;
 int n,i=1,j,g,address=99,ch;
 int ram[100];//4taii
 int memory[100];
 /*cout<<"plz enter number of lines:\n";
 cin>>n;
 forfor(i=0;i<n;i++){
  cout<<"enter:\n";
  cin.get(a,60);
  g=jomleTokalame(str,a,0);
  cout<<'\n'<<g;
  for(j=0;j<=g;j++)
   cout<<str[j];
 }*/
 string matn[100];
 s="30 input x";
 int loc=0;
 g=jomleTokalame(matn,s,0);
 //while(i<g){
  /*if(i==0){//tabdile string to int?????????????
   location[i]=matn[i];
   i++;
  }*/
 i=1;
 cout<<matn[i];
  if(matn[i]=="input"){
   cout<<"sa;";
   memory[loc]=10;
   ram[loc]=memory[loc]*100+address;
   address--;
   cout<<"ram="<<ram[loc]<<'\n';
   loc++;
   cout<<address<<'\t'<<loc;
   i++;
  }
}



For example in this program I want change the (30 input x) to a four-digit number and put them into the ram array. :confused:

Thanks in advance!
Posted
Updated 13-Feb-11 3:35am
v6
Comments
Manfred Rudolf Bihy 13-Feb-11 9:35am    
Edit: Minor spelling changes. Removed superflous pre tag.
mf_arian 13-Feb-11 9:50am    
i donnot know what should i do?

1 solution

According to what you posted, there is no compilation error, just warninds. And theses warnings are easy to solve: just delete the variables they point out. Warnings say 'you declared a variable but you never use it'... If they are not usefull then just get rid of them.

If your problem is not related to these warnings, then please describe what you are trying to do.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900