compatibility

Eric Klumpp eric.klumpp at emailforever.com
Sun May 26 02:12:36 BST 2002


I have already developped with Borland C++, and I have resolved some 
problems by using kdevelop. But I know some differences like, under 
linux, an empty line must be after the "#endif" of the header files (and 
perhaps eiver before).

Can you specify the errors you obtained, the kdevelop version.... ?

Eric


Ryszard Klos wrote:

>I'm mostly using Borland C++ builder under Windows. Recently I've installed 
>Linux and I started using Kdevelop. I'm attaching five files main.cpp, 
>student.h, studend.cpp, studentAt.h and studentAt.cpp which are my Laboratory 
>assignment from college showing class inheritance and polymorphism. This 
>program compiles with no errors under C++ builder, under Kdevelop I'm 
>receiving quite a few (starting from syntax error ??). I wrote couple 
>programs for college using both compilers, up to this time I was able to 
>figure out difference necessary to make program compile in both environments, 
>but this time I have no clue where to start, because I don't see anything 
>wrong.
>If you may tell me where is the problem?
>I'd like to get better knowledge about Kdevelop to and try transfer my little 
>program supporting programming CNC mills to Linux environment.
>
>Sincerely,
>
>
>Ryszard Klos
>Ryszardklos at attbi.com
>Info at cncmilleditor.com
>
>
>------------------------------------------------------------------------
>
>#ifndef STUDENTAT_H
>#define STUDENTAT_H
>#include <string.h>
>#include <iostream.h>
>#include <stdlib.h>
>#include "student.h"
>
>class studentAt : public student
>{
>  private:
>   string studSport;
>  public:
>   virtual void identify();
>   studentAt(string sName,string sSSN, string sSport);
>};
>#endif
>
>
>------------------------------------------------------------------------
>
>#ifndef STUDENT_H
>#define STUDENT_H
>
>#include <string.h>
>#include <iostream.h>
>#include <stdlib.h>
>
>class student
>{
>protected:
>   string   studName;
>   string   studSSN;
>public:
>   virtual void identify();
>   student(string sName,string sSSN):studName(sName),studSSN(sSSN)
>   {};
>};
>#endif
>
>
>------------------------------------------------------------------------
>
>/***************************************************************************
>                          studentAt.cpp  -  description
>                             -------------------
>    begin                : Sat May 25 2002
>    copyright            : (C) 2002 by Ryszard Klos
>    email                : Rychu at iname.com
> ***************************************************************************/
>
>/**************************************************************************/
>#include <string.h>
>#include <iostream.h>
>#include <stdlib.h>
>#include "studentAt.h"
>// ***************************************************************************
>studentAt::studentAt(string sName,string sSSN, string sSport):student(sName,sSSN)
>{
>  studSport = sSport;
>}
>// ***************************************************************************
>void studentAt::identify()
>{
>     cout << "Student's Name " << studName << " Student's SSN " << studSSN << " Student's Sport " << studSport << endl;
>}
>// ***************************************************************************
>
>
>------------------------------------------------------------------------
>
>/***************************************************************************
>                          student.cpp  -  description
>                             -------------------
>    begin                : Sat May 25 2002
>    copyright            : (C) 2002 by Ryszard Klos
>    email                : Rychu at iname.com
> ***************************************************************************/
>
>/***************************************************************************/
>#include <string.h>
>#include <iostream.h>
>#include <stdlib.h>
>#include "student.h"
>// **************************************************************************
>void student::identify()
>{
>  cout << "Student's Name " << studName << " Student's SSN " << studSSN << endl;
>}
>
>
>------------------------------------------------------------------------
>
>/***************************************************************************
>                          main.cpp  -  description
>                             -------------------
>    begin                : Sat May 25 17:05:35 EDT 2002
>    copyright            : (C) 2002 by Ryszard Klos
>    email                : Rychu at iname.com
> ***************************************************************************/
>#ifdef HAVE_CONFIG_H
>#include <config.h>
>#endif
>
>#include <iostream.h>
>#include <stdlib.h>
>#include "student.h"
>#include "studentAt.h"
>/***************************************************************************
>
> ***************************************************************************/
>
>int main(int argc, char *argv[])
>{
> student ja ("Hohn Anderson", "345-12-3547");
> student bw ("Bill Williams", "286-72-6194");
> studentAt bj ("Bob Johnson", "294-87-6285","football");
> studentAt dr ("Dick Robinson", "669-289-9296","baseball");
>
> student *stud[] = {&ja, &bw, &bj, &dr};
>
> for (int i = 0 ; i < 4 ; i++) stud[i]->identify();
>  return EXIT_SUCCESS;
>}
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop/attachments/20020526/fd088f56/attachment.html>


More information about the KDevelop mailing list