Problems with input/output file program.
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Problems with input/output file program.

  1. #1
    Join Date
    Mar 2014
    Posts
    1

    Problems with input/output file program.

    Code:
     cisDegree >> student_Identifier >> last_Name >> first_Name >> middle_Initial >> grade_Point_Average >> major_Char;
    	while (!cisDegree.eof())
    	{
    
    //Nested decision structure to write the information to the appropriate file according to their major.
    		if (major_Char == 'A')
    			appMajors << student_Identifier << " " << last_Name << " " << first_Name << " " << middle_Initial << " " << grade_Point_Average << " ";
    		else if (major_Char == 'N')
    			netMajors << student_Identifier << " " << last_Name << " " << first_Name << " " << middle_Initial << " " << grade_Point_Average << " ";
    		else if (major_Char == 'P')
    			progMajors << student_Identifier << " " << last_Name << " " << first_Name << " " << middle_Initial << " " << grade_Point_Average << " ";
    		else if (major_Char == 'W')
    			webMajors << student_Identifier << " " << last_Name << " " << first_Name << " " << middle_Initial << " " << grade_Point_Average << " ";
    		
    		cisDegree >> student_Identifier >> last_Name >> first_Name >> middle_Initial >> grade_Point_Average >> major_Char;
    	}
    I have all the variables declared, and all the files open, but for everywhere there is a >>, << before last_Name it says error 2679. im supposed to read the 6 variables from the input file and send them based on char to separate output files. Any idea on how to fix this error?

  2. #2
    Join Date
    Dec 2012
    Location
    England
    Posts
    2,262

    Re: Problems with input/output file program.

    Error c2679 means "no operator found which takes a right-hand operand of type 'type' (or there is no acceptable conversion)".
    See http://msdn.microsoft.com/en-us/library/h1925w4w.aspx

    Of what type is last_Name? You haven't provided the definitions. It would be better if you showed the whole program so that we can better advise.
    All advice is offered in good faith only. You are ultimately responsible for effects of your programs and the integrity of the machines they run on.

  3. #3
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Posts
    12,046

    Re: Problems with input/output file program.

    Nothing to do with your question, but those aren't nested if statements.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center