小弟我在一个工程中建立多个文件, 为什么有一个在树状结构图中看不见

我在一个工程中建立多个文件, 为什么有一个在树状结构图中看不见?
我建立工程名为111, 在这个工程下面我建立头文件:head.h,然后又建立方法文件method.cpp,里面定义了一些方法,然后又建立main程序文件,

这几个文件程序如下:
首先是头文件:

#ifndef HEAD_H
#define HEAD_H

class Stock
{
private:
std::string company;
long shares;
double share_val;
double total_val;
void set_tot()
{
total_val = shares * share_val;
}

public:
Stock();
Stock(const std::string &co, long n=0, double pr=0.0);
~Stock();
void buy(long num, double price);
void sell(long num, double price);
void update(double price);
    void show();
};

#endif


然后是方法定义文件:method.cpp

#include <iostream>
#include "head.h"
#include <string>
using namespace std;

Stock::Stock()
{
cout<<"Default constructor called\n";
company = "no name";
shares = 0;
share_val = 0.0;
total_val = 0.0;
}

Stock::Stock(const string &co, long n, double pr)
{
cout<<"Constructor using "<<co<<" called\n";
company = co;

if(n<0)
{
cout<<"Number of shares can't be negative; "
<<company<<" shares set to 0.\n";
shares = 0;
}
else
{
shares = n;
}
share_val = pr;
set_tot();
}

Stock::~Stock()
{
cout<<"\nBye, "<<company<<" !\n"; 
}
void Stock::buy(long num, double price)
{
if(num < 0)
{
cout<<"Number of shares purchased can't be negative. "
<< "Transaction is aborted.\n";
}
else
{
shares = shares + num;
share_val = price;
set_tot();
}
}

void Stock::sell(long num, double price)
{
if(num < 0)
{
cout<<"Number of shares sold can't be negative."
<<" Transction is aborted.\n";
}

else if(num > shares)
{
cout<<"You can't sell shares more than you have."
<<" Transction is aborted.\n";
}
else
{
shares = num;
share_val = price;
set_tot();
}

}

void Stock::update(double price)
{
share_val = price;
set_tot();
}

void Stock::show()
{
cout<<"Company "<<company<<" shares: "<<shares<<' \n';
cout<<"  Share price : $"<<share_val;
cout<<"  Total worth: $"<<total_val<<' \n';
}


再是主函数main

#include <iostream>
#include "head.h"
using namespace std;

int main()
{
{
cout<<"Using constructors to create new objects\n";
Stock stock_1("abc", 14, 20.0);
stock_1.show();
}

return 0;
}


我的VC左边的结构图为

小弟我在一个工程中建立多个文件, 为什么有一个在树状结构图中看不见
怎么看不见method.cpp这个文件,每次要打开它时只能在菜单“文件“””中的“最近使用的文件“””中找到?

另外,为什么我的输出结果为小弟我在一个工程中建立多个文件, 为什么有一个在树状结构图中看不见

明明价格是14,怎么变成了148202?我检查了一下,没找出错在哪里。
------解决方案--------------------
人才啊,你看的 树状结构图是 类视图,又不是文件视图,有选项卡的。你是只有一个类视图的选项卡么?还是你没看见?
------解决方案--------------------
引用:
Quote: 引用:

人才啊,你看的 树状结构图是 类视图,又不是文件视图,有选项卡的。你是只有一个类视图的选项卡么?还是你没看见?

文件视图和类视图不是一回事!


你想表达什么?当然不是一回事,有选项卡,切换到文件资源视图的选项卡 才看得到 文件组织
------解决方案--------------------
楼主你输出错误 是在
cout<<"Company "<<company<<" shares: "<<shares<<' \n';

‘ \n’

改为:
" \n"