CnUnix

[알림판목록 I] [알림판목록 II] [글목록][이 전][다 음]
[ CnUnix ] in KIDS
글 쓴 이(By): memory (라면밥말아)
날 짜 (Date): 2006년 4월 14일 금요일 오전 08시 30분 42초
제 목(Title): DEV-C++ 에서 C++ 코드 컴파일법?



unix g++에서 컴파일할때는 아무 문제 없다가 
dev-c++이 좋다길래 PC에서 컴파일할려고 하는데
무수한 에러만 보이네요.
dev-c++에서 c++코드 컴파일하려면 어떤 옵션을 변경해야하나요?
참고로 아래같은 코드조차 별 이상한 에러들이 나면서 컴파일이 안됩니다.




#include <iomanip>
#include "graph-adj.h"

using namespace std;


//const double Graph::NO_EDGE = 1.0e100; //define NO_EDGE's value 
for class
const bool Graph::NO_EDGE = false; 

void Graph::SetSize(int n) 
{
myA.SetDimensions(n,n);
for (int o = 0; o < myA.size(); ++o)
for (int d = 0; d < myA.size(); ++d) {
myA[o][d] = NO_EDGE;
}
}

void Graph::AddEdge(int origin, int destination, bool value) 
{
if ((myA[origin][destination] == 
NO_EDGE)&&(myA[destination][origin] == NO_EDGE))
++myNumEdges;
myA[origin][destination] = value;
myA[destination][origin] = value;
}

void Graph::RemoveEdge(int origin, int destination) 
{
if ((myA[origin][destination] != 
NO_EDGE)&&(myA[destination][origin] != NO_EDGE))
--myNumEdges;
myA[origin][destination] = NO_EDGE;
        myA[destination][origin] = NO_EDGE;
}

bool Graph::HasEdge(int origin, int destination)  const
{
   return myA[origin][destination] != NO_EDGE;
}

bool Graph::EdgeValue(int origin, int destination)  const
{
   return myA[origin][destination];
}

ostream& operator<<(ostream &os, const Graph &g)
{
os << "    ";
for (int d = 0; d < g.NumNodes(); ++d) 
os << setw(4) << d;
os << endl;
    
    for (int o = 0; o < g.NumNodes(); ++o)
    {
os << setw(4) << o;
for (int d = 0; d < g.NumNodes(); ++d)
if (g.myA[o][d] == Graph::NO_EDGE)
os << "    ";
else
os << setw(4) << g.myA[o][d];
      os << endl;
    }
    
    return os;
}

int Graph::NodeUnDegree(int node) const
{
    int i, total=0;

    for(i=0; i < NumNodes(); i++) {
                if (myA[i][node] != NO_EDGE) total++;
    }

        return total;
}




int Graph::NodeInDegree(int node) const
{
    int i, total=0;
    
    for(i=0; i < NumNodes(); i++) {
if (myA[i][node] != NO_EDGE) total++;
    }

return total;
}


int Graph::NodeOutDegree(int node) const
{
    int i, total=0;
    
    for(i=0; i < NumNodes(); i++)
if (myA[node][i] != NO_EDGE) total++; 

return total;
}



int Graph::NodeDegree(int node) const
{
    return NodeInDegree(node) + NodeOutDegree(node);
    //return NodeUnDegree(node);
}


[알림판목록 I] [알림판목록 II] [글 목록][이 전][다 음]
키 즈 는 열 린 사 람 들 의 모 임 입 니 다.