NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

Code is working in Terminal but not in NetBeans

 
Post new topic   Reply to topic    NetBeans Forums -> C/C++ Users
View previous topic :: View next topic  
Author Message
travelgravel



Joined: 30 Nov 2016
Posts: 2

PostPosted: Wed Nov 30, 2016 2:26 am    Post subject: Code is working in Terminal but not in NetBeans Reply with quote

Earlier today I was messing around with a different program and nothing out of the ordinary happened. I came back later to begin working on my final project. I was testing some old code and I must have done something wrong when I was working earlier. I can run this program in the terminal and have no problems getting the correct output. When I try to run the code in netbeans I get the error that I listed below. I am not sure why there would be an issue in the path. The code that I am working on here is where I have made my own String class.

#include <cstdlib>
#include <iostream>
//#include <fstream>
//#include <string>


#include "String.h"

using namespace std;
/*
*
*/
int main(int argc, char** argv) {

//Testing Default constructor, length, and print
String one;

//Testing Alternate constructor, length, and print
char test[] = "Hello world";
String two(test);


//Testing Copy constructor, length, and print
String three(two);
cout << "The length of String three is: " << three.length() << endl;
cout << "The value of String three is: ";
three.print();

//Testing the == operator. This should replace your equal() method
if (one == two) cout << "one and two are equal" << endl;
else cout << "one and two are not equal" << endl;

if (two == three) cout << "two and three are equal" << endl;
else cout << "two and three are not equal" << endl;

//Testing the overloaded [] operator. This replaces your at() function.
cout << "The letter at index 6 is: " << two[6] << endl; //should return w
cout << "The letter at index 11 is: " << two[11] << endl; //should return an error (index out of bounds)

return 0;
}

The error message that I am getting is below

cd '/Users/chrisellis/NetBeansProjects/Final_Project' /usr/bin/make -f Makefile CONF=Debug Cannot run program "/private/var/folders/jh/sk42dfln2s95myy_nwy884zm0000gn/T/dlight_chrisellis/8d1ceb39/1783541842/pty": error=2, No such file or directory

BUILD FAILED (exit value -2, total time: 57ms)
Back to top
travelgravel



Joined: 30 Nov 2016
Posts: 2

PostPosted: Wed Nov 30, 2016 2:48 am    Post subject: Reply with quote

I solved the problem by deleting NetBeans and reinstalling it
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> C/C++ Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo