
16-03-2008, 11:44
|
|
|
|
חבר מתאריך: 23.10.06
הודעות: 17
|
|
|
שאלה בsystemc
הורדתי והתקנתי את הקבצים של systemc ועשיתי build, כך שsystemc מותקנת. - על visual C++6.0
יש לי תכנית שאני מנסה להריץ והקומפיילר לא מוצא סיפריית stdafx.h:
קוד:
//////////////////////////////////////////////////////////////////////
// graph_alg.cpp : main project file.
//
// Functions:
// queue::push(), queue::pop(), queue::empty(), queue::back(),
// queue::front(),queue::size()
//
#include "stdafx.h"
#include <iostream>
#include <queue>
#include <deque>
#include <list>
#include <string>
using namespace std; // std c++ libs implemented in std
using namespace System;
using namespace System::Collections;
// Define a node class that will hold graph nodes
class node {
public:
string name ;
list<node*> son ; // pointer to list of sons
node* father ; // pointer to father
};
// Using queue with deque
typedef deque<node*> NODE_DEQUE;
typedef queue<node*,NODE_DEQUE> NODE_QUEUE;
void main() {
int size_q; node* n ;
NODE_QUEUE q;
// Insert items in the queue(uses deque)
n = new(node) ; n->name = "A" ;
q.push(n);
n = new(node) ; n->name = "B" ;
q.push(n);
n = new(node) ; n->name = "C" ;
q.push(n);
n = new(node) ; n->name = "D" ;
q.push(n);
// Output the last item using back()
cout << "last item in queue is " << q.back()->name << endl;
// Output the first item using front()
cout << "first item in queue is " << q.front()->name <<
endl;
// Output the size of queue
size_q = q.size();
cout << "size of q is:" << size_q << endl;
// Output items in queue using front()
// and use pop() to get to next item until
// queue is empty
while (!q.empty())
{
cout << q.front()->name << endl; q.pop();
}
}
האם מישהו יודע מה הבעיה
תודה מראש.
|