我试图让Eclipse v3.5(Galileo)在我的计算机上重新运行 - 我之前运行它没有任何问题,但现在我不断收到此错误:
必须提供Java运行时环境(JRE)或Java开发工具包(JDK)才能运行Eclipse.搜索以下位置后未找到Java虚拟机:当前PATH中的C:\ eclipse\jre\javaw.exe javaw.exe
我刚刚完成了JDK和SDK的全新安装.
我有Windows 7(x64).
怎么了?我如何解决它?
我无法运行任何ipconfig/tracert /或ping.
我正在编写我的编程任务的"驱动程序"部分,我不断得到这个荒谬的错误:
错误C2065:'cout':未声明的标识符
我甚至尝试过使用std :: cout,但我得到另一个错误:IntelliSense:命名空间"std"没有成员"cout"当我声明使用命名空间std,包括iostream +我甚至试图使用ostream
我知道这是一个标准的菜鸟问题,但这让我感到难过,我是一个新手(意思是:我之前已经编程了......)
#include <iostream>
using namespace std;
int main () {
cout << "hey" << endl;
return 0;
}
Run Code Online (Sandbox Code Playgroud)
我正在使用Visual Studio 2010并运行Windows 7.所有.h文件都有"using namespace std"并包含iostream和ostream.
窗口 - >首选项 - >常规 - >编辑器 - >文本编辑器 - >显示行号
我刚刚安装了Eclipse Galileo(第一次)并且正在用C++编程,无法让编辑器显示行号...当我用Google搜索它时,我得到了以下指示:
转到窗口 - >首选项 - >编辑器 - >外观,然后选中显示行号
但是,当我按照这些指示 - 没有"显示行号"复选框?我在哪里可以获得启用此功能的"插件"?或Eclipse是否有行号?
注意:我安装了CDT
Matthew Flaschen和Michael Burr指出了重载的Node(int)调用构造函数的问题,Node()这是不行的,因为...
谢谢你们!
我已经构建了一个程序(我正在调试它)并且遇到了一个奇怪的问题......一个`if`语句没有被触发它应该是......这是一个学校项目,我们必须用它构建一个AVL树至少有一个'优化'功能.
我确信并且已经测试过`rdown`和`ldown`工作(作为平衡因素) - 树不是完全平衡的.相反,它是基于分支的高度(即 - `balance()`应该只返回(1,0,-1)否则它是不平衡的.
我希望这是解决这个奇怪问题的足够信息......在使用Microsoft Visual Studio 2010之前,我从未遇到类似这样的事情.
struct Node {
int data; // the data in the Node
int rdown; // the number of ellements below the node on the right side
int ldown; // the number of ellements below the node on the left side
Node * parrent; // the node's parrent
Node * lchild; // the nodes left child …Run Code Online (Sandbox Code Playgroud) 正如问题所解释的那样:我想添加一些仅在程序附加到调试器时运行的调试代码。我想这个flag或pre-processor变量对于每个编译器都会不同......
就我而言,我将 Microsoft Visual Studio 2010 与 C++ 一起使用。
我还在家里的另一台运行 Ubuntu 10.4 和 C++ 的计算机上使用 Eclipse。
我想启用IntelliSense "自动"功能(如Visual Studio C#2008 Express),但我使用的是Visual Studio C++ 2008 Express Edition,在工具>选项>文本编辑器> C/C++中(没有选项'IntelliSense) '(比如Visual C#).如何启用此功能?我知道我可以获得一个快捷方式(CTRL-space等...)?但是如何自动获取它(下拉菜单)?
我想创建一个按钮,我可以使用pyGTK控制按钮的外观.我该怎么做呢?
我希望能够为按钮所处的每个"状态"指向一个新图像(即按下,鼠标悬停,正常...等)
我运行以下程序时收到NullReferenceException.我认为问题来自于我正在创建一个Line包含Point类的事实.
using System;
class Driver
{
static void Main()
{
Point pOne = new Point();
Point pTwo = new Point(2, 1);
Console.Write("Point pOne: ");
PrintPoint(pOne);
Console.Write("Point pthree: ");
PrintPoint(pTwo);
Line lOne = new Line(pOne, pTwo);
Console.WriteLine("Line lOne: ");
PrintLine(lOne);
//Rectangle rOne = new Rectangle();
Rectangle rOne = new Rectangle(lOne);
Console.WriteLine("Rectangle rOne: ");
PrintRectangle(rOne);
Console.ReadLine();
}
// The PrintPoint method
// purpose: display the coordinates of a Point
// Parameters: a Point object
// returns: none
static …Run Code Online (Sandbox Code Playgroud) 我正在努力理解递归,我想我已经好了......我正在尝试构建一个搜索函数(比如std :: string.find()),它搜索给定字符串中的另一个字符串,例如:
给(大)字符串:"ru the running cat"
搜索(小)字符串:"运行"
我正在尝试返回我正在搜索的单词的索引(在上面的情况下它将是**7)我有的递归方法如下 - 我似乎无法让它返回索引正常.
index = index_of(imput.c_str(), search.c_str())
Run Code Online (Sandbox Code Playgroud)
int index_of( const char * i, const char * s) {
int j;
if (*s == '\0') { return; }
if (*i == '\0') {
return NULL;
}
else if ( *i == *s ) {
index_of((i++), (s++));
}
else {
j += index_of((i++), s);
}
return j;
}
Run Code Online (Sandbox Code Playgroud)
另一个可预见的问题是,当(例如 - 好的它很糟糕,但我需要一个有效)它到达"ru_"它仍然停留在''(空间) - >我怎么能让它'重置' s指针?
我目前正处于拼贴二级编程课程......我们正在研究运算符重载...要做到这一点,我们要重建矢量类...我正在构建类,发现它的大部分是基于[] operator.当我试图实现时,+ operator我遇到了一个奇怪的错误,我的教授以前没见过(显然是因为班级将IDE从MinGW切换到VS表达...)(我正在使用Visual Studio Express 2008 C++版......)
#include <string>
#include <iostream>
using namespace std;
#ifndef _VECTOR_H
#define _VECTOR_H
const int DEFAULT_VECTOR_SIZE = 5;
class Vector
{
private:
int * data;
int size;
int comp;
public:
inline Vector (int Comp = 5,int Size = 0)
: comp(Comp), size(Size) { if (comp > 0) { data = new int [comp]; }
else { data = new int [DEFAULT_VECTOR_SIZE];
comp = DEFAULT_VECTOR_SIZE; }
}
int size_ () const …Run Code Online (Sandbox Code Playgroud) 我一直收到这个错误 -
错误C2819:类型'List'没有重载成员'operator - >'
我无法弄清楚为什么?救命?
Main.cpp -
#include <iostream>
#include <string>
#include <cassert>
using namespace std;
#include "List.h"
#include "Node.h"
Run Code Online (Sandbox Code Playgroud)
错误发生在这里:
void PrintList ( List list ) {
Node * temp = list.getFirst();
Node * temp2 = list->getLast();
while ( temp->getItemName() != temp2->getName() ) {
cout << temp.getItemName() << endl;
}
}
Run Code Online (Sandbox Code Playgroud)
List.h -
#ifndef LIST_H
#define LIST_H
#include "Node.h"
class List
{
private:
Node * First;
Node * Last;
int num_in_list;
public:
List () { num_in_list = 0; …Run Code Online (Sandbox Code Playgroud) 我想从用户那里得到输入,并且需要知道一个办法让程序识别输入的是或不是双/焦炭这就是我现在所拥有的......但是当你输入了不正确的输入类型
1)双重测试只是无限循环
2)即使使用正确的输入,char也不会停止循环
int main () {
double _double = 0;
bool done = true;
while ( done ) {
cout << "Please enter a DOUBLE:\n" << endl;
cin >> _double;
if ( _double > 0 ) { done = false; }
if ( _double < 0 ) { cout << "\nthe number you entered was less than zero\nplease enter a valad number..." << endl; }
if(cin.fail()) { cin.clear(); }
}
done = false;
char _char …Run Code Online (Sandbox Code Playgroud) 我正在尝试将10台计算机连接在一起,我想编写的程序将有一台"控制"计算机.从我看到的这台计算机将采取通过网络发送的所有数据包并与他们回应...对吗?其他计算机需要能够发送信息(然后回显给其他人)到'控制'......有一个简单!或简单的方法来做到这一点?从我看到的我想要一个非阻塞套接字?
我已经研究过套接字等,但对于像我这样的业余程序员来说,这似乎是一项艰巨的任务:)
我很善于寻找具有send()事件和事件驱动力的简单类意蕴recv().
我不会通过网络发送那么多信息.
c++ ×10
class ×2
eclipse ×2
pointers ×2
c# ×1
debugging ×1
exception ×1
if-statement ×1
input ×1
intellisense ×1
java ×1
line-numbers ×1
loops ×1
namespaces ×1
networking ×1
null ×1
path ×1
pygtk ×1
python ×1
recursion ×1
search ×1
std ×1
visual-c++ ×1