- Upvotes Received
- 1
- Posts with Upvotes
- 1
- Upvoting Members
- 1
- Downvotes Received
- 2
- Posts with Downvotes
- 2
- Downvoting Members
- 2
40 Posted Topics
Re: I've never seen the time function but I would just guess it would have to look like this. a=sqrt(x); j=time(sqrt(x)); | |
Hey everyone, This is my first time here just to let ya know. Hopefully you can help me. :D The language is C++. I am currently working on a file that consists of functions to manipulate doubly linked lists from the main program. After writing several function everything was fine. … | |
Re: I didn' know you could resize an array. I thought thats what vectors were for. | |
Re: Speak clean english and you might get a few more responses. | |
Hi everyone Basically I want to set-up a linux machine at home so I can do my programming here. Any recommended distros that are fairly easy to run and come with a good compiler for c++? Thanks. | |
Hey everyone, Alright, my project requires that I write a program to demonstrate my understanding of class inheritance. Problem is the teacher wants us to use Java, something I have never used and the teacher did not even give us a crash course in. Right now I am trying to … | |
Hi everyone, I need to write a compiler with Yacc that will basically perform minor algebraic commands. Here is the code so far for the Yacc part. [code] %token INTEGER VARIABLE READ WRITE %left '+' '-' %left '*' '/' %{ #include <stdio.h> void yyerror(char *); int yylex(void); int sym[26]; int … | |
Hi everyone, I need to write a compiler using Yacc and I have encountered a problem. Since some of the code is C i thought I would try here. The problem occurs at one line in the following program. Once running, everything runs fine till this line is hit, then … | |
Re: Are you expecting someone to write the code for ya? | |
Re: Heres a quick algo I just threw together. There probably are more efficient ways but this gets the job done. [code] float min, max, temp, count; count = 0; cin >> max; // Read in first # cin >>temp; // Read in second # if (max > temp) // This … | |
I am writing a program that will build a graph and then find the lowest costs between any given vertices. I have the program building the graph just fine, but now I just started to write the part that will find lowest costs and I get a seg fault error. … | |
Re: Don't know if there is a function built-in off the top of my head but it would be so easy to just write your own. double max_find() { double max = 0; // This may need to be initalised different base on your data for (int i = 0; i … | |
I need to set a variable to infinity or the highest possible number for the computer. But I have no idea how to do this. I did this a little while dabbling in assembly but I am unsure how to do this in C++. Thanks. | |
Re: [QUOTE=nowmn]sorry my bad english and maybe if u can write this source so give me ? (use a stack and tree) :cool:[/QUOTE] Are you kidding me? The last person to try this at least offered to pay money. :rolleyes: | |
Re: If you can't write it in english you won't be able to write it in c++. A quote from my teacher, "the sooner you start to code, the longer the program will take to write". | |
Re: Your function loan_schedule is written wrong. The function header requires parameters. While your function call and prototype have no parameters. I'm surprised it even compiles. Future note also. If you post again put the code in bb tags and in a much more easy on the eyes form. Dont have … | |
Re: Is it compiling? I am not 100% confident with c++ but I don't think what your doing is possible. Try something like this... final_grade = (.4*midterm)+(.6*final); | |
Re: Where is the problem occuring? Have you done any debugging at all? Do your records that you attempt to sort even exist? | |
Re: First thing I see on quick glance is you need an endline command at the end of the for loop. | |
Re: Just curious, was that code segment from the book or did you just make it up without thinking about the logic? Just looks like a goofy piece of code. | |
Re: Oh, how about fin >> some_array[whatever_index]; I think you can fill in the right names. | |
Re: Whats wrong here? Are you having a problem or do you expect someone to write the program for you? | |
Re: I can't help you but I have a feeling for anybody to be able to help you, you are going to have post some more info. You are asking a pretty broad question right now. | |
Re: ^^ Exactly. You need to find where the seg fault is hitting. When I have that problem, I usually fill my program with stupid couts like "entering _____ function", "about to enter so and so loop", "got out of so and so loop" blah blah blah | |
Re: Have you read some of the shit Narue has had to answer? I think this thread was quite uncalled for. I personally have no problem with Narue and have received good help from him/her on a couple of occasions. Just don't come to this board expecting everyone to write your … | |
Re: cout<<"\naverage of these numbers: "<<ave<<endl; You are not passing any of you parameters in ave. I am surpised it is compiling at all. Should look like ave(array, 10). | |
Hey everyone, I just started writing this program when I hit a problem with the destructor. Me and my buddies in the lab could not figure out what is going on. The error said something about symbol referencing error and refers to the destructor. The program is set in three … | |
Re: First, your surface equation is wrong. Surface area is simply lengh*width. I'm not even sure what that equation you are using will actually calculate. The warning comes from cramming a double into an int. Generally you would want to avoid that but in this case you can trust the compiler … | |
Hey Everyone, I need to write a program where the first half builds what is basically a file directroy tree. Files and their paths will come in from file in the form... /program/file/whatever ... and be read into a string. Problem is I don't know how to manipulate strings very … | |
Re: Just a handful of errors. First it probably was not compiling because of this area int hours, //#of hours minutes, //# of minutes should be `int hours, minutes;` Also this area has logic problems.. //Do the calculations hours = hours; minutes = hours / 60; //Display the results cout<<"\n hours" … | |
Re: First, are you familiar with a stack and its methods? If you are the process is simple. Based on what you have said, while(!eof(yourfile)) { fin >> temp; stack.push(temp); } At the moment I am making the assumption you are familier with stacks and can declare the variables I used. … | |
Re: [QUOTE=quasimof] int main(void) { int num=0; int i=0; cout<<"num"; cin>>num; while(i<num) { num=num%i; i++; } . . [/QUOTE] Not a master of the language but the error might be that you are dividing by zero. Not sure how C++ handles that off the top of my head. | |
Re: Sorry, this is off topic but do you happen to go to Western Michigan U? | |
Re: I can't find the problem but wouldn't it be better to have a while loop instead of a do-while. You never check to make sure the infile has anything in it to start with. What exact line does the compiler say is wrong? | |
I need to write a class using a vector and this is my first time using vectors. But I have looked through several books/web pages and can't see why this thing won't compile. #include <vector> template <class el> class pQ { public: private: vector<el> a(1); }; Any ideas. There must … | |
Re: What have you gotten so far, or have you tried to write any code? | |
Re: [QUOTE=fahad]Hi; U have specified that u want to break the loop when the user do not enter any input, but u havent specify for how much time loop will wait for the user input after wich it will break automatially ???u have to specify time limit and use system clock … | |
I asked this before but didn't get an answer so I went to talk to my "professor" and he just about made me want to quit programming :( . So a little help would go great lenghs to salvaging this day. Basically I have to right a program that reads … | |
Hey Everyone Right now I am writing a file that needs a queue defined as a class. The queue has a function called 'front' that should return a reference to the front element of the queue. Needs to be a reference so the element can be altered. Bloc is a … |
The End.