C++ "invalid operands of types 'bool' and 'short int*' to binary 'operator*'" hatası

479980

Decapat
Katılım
29 Temmuz 2021
Mesajlar
742
Çözümler
1
Arkadaşlar aşağıdaki kodda hata alıyorum.

C++:
#include <iostream>
#include<windows.h>
#include<replace.h>
#include<clocale>
#include<fstream>
#include<string>
#include<find.hpp>
#include"libs\ccolor.h"
#include"libs\sys.hpp"

using namespace std;
int main(int argc, char** argv) {
    sys sys;
    setlocale(LC_ALL,"turkish");
    fstream runner("runner.bat");
    //string* file=new string;
    string* impc=new string;
    string newfile;
    string order;
    long int* countL=new long int;
    long int* ocount=new long int;
    short int* blimit=new short int;
    *blimit=0;
   
    bool* run=new bool;
   
    *run=true;
    *countL=1;
    *impc="import[sys.r];";
    *ocount=0;
   
    while(*run){
        cout<<green<<"$ "<<yellow;
        getline(cin,order);
        if(order[0]!=' '){
            if(order[0]=='r' && order[1]=='u' && order[2]=='n' && order[3]==' '){
                replace(order,"run ","");
                cout<<order<<endl;
                ifstream rFile(order.c_str());
                newfile=order;
                replace(newfile,".faz",".cpp");
                if(rFile.is_open()){
                    fstream nFile(newfile.c_str(),ios::app);
                    cout<<"opened..\n";
                    while(!rFile.eof()){
                        ++*ocount;
                    }
                    while(!rFile.eof()){
                        string* line=new string;
                        rFile>>*line;
                        if(*countL==1){
                            if(*line==*impc){
                                replace(*line,*impc,"#include<sys.h>\n\n");
                                nFile<<*line;
                            }
                        }
                        if(*line=="begin:" && *blimit!=1){
                            replace(*line,"begin:","using namespace std;\n\nint main(){")
                            ++*blimit;
                        }else if(*blimit==1){
                            delete blimit;
                        }
                       
                        delete line;
                        ++*countL;
                    }
                }
            }
        }
    }   
    return 0;
}

Aldığım hata:

[Error] invalid operands of types 'bool' and 'short int*' to binary 'operator*'

Hata satırı :

++*blimit;
 
Aynı değişken için iki farklı tip operatör tanımlanmış. Bunu düzeltmeni istiyor. örn: bir değişken string olarak tanımlanmış daha sonra bu değişken integer türünden değer artışı işlemi görüyor. Bunu kabul etmiyor çakıştığı için
 

Hocam kodlarda öyle bir şey yok ama.
 
Blimit değişkenini bir sorguda siliyorsun. Belki o nokta ile çakışıyor olabilir.
 
Son düzenleyen: Moderatör:
Bu siteyi kullanmak için çerezler gereklidir. Siteyi kullanmaya devam etmek için çerezleri kabul etmelisiniz. Daha Fazlasını Öğren.…