473,385 Members | 1,445 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

minimize DFA c++ code has error

hello

I have a problem In this code


//Function to minimize DFA
pair<int,vector<string tuple<int,int,bool>> > minimize_dfa(vector<dst) {
cout<<dfa.size()<<endl;
vector<int> grp(dfa.size()); /// Group number for states
vector<vector<int> > part(2, vector<int>()); /// Partition for groups

/// Initializing the groups
int part[0],.push_back(0);
for(int i=1; i<(int)grp.size(); i++) {
if(dfa[i].f==dfa[0].f) {
grp[i]=0;
part[0].push_back(i);
} else {
grp[i]=1;
part[1].push_back(i);
}
}

if(!part[1].size()) part.erase(part.end());


in the first line this message will appear
([Error] template argument 1 is invalid)

does any one know about this situation ?
Dec 16 '17 #1
1 2132
weaknessforcats
9,208 Expert Mod 8TB
Your function template minimize_dfa has an argument of vector<dst.

What is vector<dst ?? There's a missing > and an argument name.

Did you mean vector<dst> arg1 ??

There's also a typecast of grp.size() to an int. Anytime you cast in C++ it's an error unless you are interfacing with old-style C code. In this case vector::size returns a size_type, not an int.

You should be using iterators with vectors.
Dec 16 '17 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Amit Kela | last post by:
Hey, I am getting the following error when I try to delete the contents of a recordset under a condition statement. Is there any way I can delete them without running into this error? I need to...
6
by: geronimo_me | last post by:
Hi, I am trying to run an Excel macro from an Access module, however when I run the code the macro runs but then I get an error in Access. The error is: Run-time error "440", Automation error. ...
4
by: yanyo | last post by:
hi, im trying to figure out whats the problem with this program i get a runtime error but i dont see where the problem is i tried changing declaration but nothing if somrbody can try this on their...
4
by: SteadySteps | last post by:
Hi I migrated a project which compiles correctly on VC 6.0 to VS 2002. However now all I get several warning that all the statements within catch blocks are "unreachable code". How can I correct...
8
by: Doug Bell | last post by:
Hi, I have been debugging a new VB.Net Application and today, I have been getting an error that I have not seen before This error is now appearing on a line with the following code: lnGUID =...
1
by: xian2 | last post by:
Hi All, I have been using this guide http://www.compasscomputing.co.uk/code/AcceesReportsToPDFandEmail.htm to create a command button that automatically saves and e-mails your report and have...
7
by: JewelsT | last post by:
Hello, I'm new to both RSS & XML and I am trying to create a ColdFusion RSS feed. I have my cfm file with all my code and at the end of the file I am writing that output to an XML file. At the top...
1
by: TSalm | last post by:
Hi, After sending a request, I would get the possible error message. Not the code @@error, nor the exact content of sysmessages, but the message like it could be in the log file. TIA, TSalm
13
by: problem. | last post by:
#include <stdio.h> #include <stdlib.h> int main(void) { int a, b; float result = 0.0f; char symbol = '\0'; int loop = 0;
0
by: vagueante | last post by:
Hi, I have a windows service that i connecto to a iSeries Dataqueue, i can write and read from it. The purpose of this service it's to keep reading the dataqueue and when it has some data i run...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.