小编use*_*133的帖子

吉蒂格尔没有工作

我的.gitignore文件由于某种原因无法正常工作,并且没有任何谷歌搜索能够修复它.这是我有的:

*.apk
*.ap_
*.dex
*.class
**/bin/
**/gen/
.gradle/
build/
local.properties
**/proguard/
*.log
Run Code Online (Sandbox Code Playgroud)

它在目录中master,这是我的git repo.我正在运行Git 1.8.4.2因为我在MacBook上运行OSX 10.8.6.

git gitignore

192
推荐指数
10
解决办法
15万
查看次数

类方法最后返回类C++

所以对于学校我必须创建一个包含时间和数字的Node类(稍后用于插入排序).我还是C++的新手,所以我可能在这里做错了,但每当我调用我的GetNumber()方法时,它只会返回最后一个节点的编号.我的代码如下:

Node.cpp

#include "Node.h"
int n, t;

Node::Node(int number, int time)
{
    n = number;
    t = time;
}


Node::~Node(void)
{
}

int Node::GetTime(void)
{
    return t;
}

int Node::GetNumber(void)
{
    return n;
}
Run Code Online (Sandbox Code Playgroud)

在主要:

Node f(123, GetTickCount());
for (int i = 0; i < 1000; i++){}
Node g(124, GetTickCount());
for (int i = 0; i < 1000; i++){}
Node d(111, GetTickCount());
cout << f.GetNumber() << "  " << f.GetTime()<<endl;
cout << g.GetNumber() << "  " << g.GetTime()<<endl;
cout << …
Run Code Online (Sandbox Code Playgroud)

c++

1
推荐指数
1
解决办法
53
查看次数

标签 统计

c++ ×1

git ×1

gitignore ×1