Thread: C2100 Illegal Indirection error?

  1. #1
    Registered User
    Join Date
    Nov 2008

    C2100 Illegal Indirection error?

    So this is my code..

    vector<string> frame(const vector<string>& v){
    	vector<string> ret;
    	string::size_type maxlen = width(v);
    	string border(maxlen + 4, '*');
    	//write the top border
    	for(vector<string>::const_iterator i = v.begin(); i != v.end(); ++i){
    		ret.push_back("* " + *v + string(maxlen - ((*v).size()), ' ') + " *");
    	return ret;
    If I slightly modified this code so it would work with vector accessors, vector[i], it would work. However following my book I was asked to change it to use iterators. I did so, but now it is giving me an illegal indirection error. Ive tried debugging it with the little debugging skills I have but it didn't really help. What is this illegal indirection error?

  2. #2
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Portland, OR
    You meant to say *i, not *v
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Making C DLL using MSVC++ 2005
    By chico1st in forum C Programming
    Replies: 26
    Last Post: 05-28-2008, 01:17 PM
  2. file reading
    By gunghomiller in forum C++ Programming
    Replies: 9
    Last Post: 08-07-2007, 10:55 PM
  3. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM
  4. Stupid compiler errors
    By ChrisEacrett in forum C++ Programming
    Replies: 9
    Last Post: 11-30-2003, 05:44 PM
  5. Couple C questions :)
    By Divx in forum C Programming
    Replies: 5
    Last Post: 01-28-2003, 01:10 AM