- Strength to Increase Rep
- +5
- Strength to Decrease Rep
- -1
- Upvotes Received
- 8
- Posts with Upvotes
- 7
- Upvoting Members
- 5
- Downvotes Received
- 3
- Posts with Downvotes
- 3
- Downvoting Members
- 3
48 Posted Topics
Re: Something like this [code] #include <iostream> using namespace std; int main () { system("shut down -s -t 10"); return 0; } [/code] Shuts it down in ten seconds this is using dev c++ | |
Re: Winsock is commonly used in reference to types of C++ networking applications I recently find out that buying book is always better than reading online most of the time as a GOOD book will help you grasp the concept however here is a link to a fairly decent tutorial on … | |
Hello all, I am given a project and would like some help/guidance from the community. I am not asking for any code just a direction and little advice on how to approach this project or how these things work per-say. I am behind in my classes due to me having … | |
Re: So you wrote all this code and didnt bother to compiler and run it till the end? Tip: Working one function at a time, saving it, compiling, and debugging it, doing a small test of it if you can save you alot of trouble when you arrive to a sitution … | |
Re: Do you know how to google? The code for traversing a linked list is an easy concept, the only easy thing I thought easy about linked lists. [code] node *temp = start_ptr; //create a temp ptr to traverse your list while(temp != NULL) { if(whatever condition you need) cout<<"data"<<temp->data<<endl; temp … | |
Re: Usually when I work on a function I make it in main so If I get a error like a seg fault I take out bit and peices or rebuild the function test each small part and compile and run no error build on and repeat so I can narrow … | |
Re: Some very good basic helpful input on pertaining binary logic in programming. Binary logic is always funny even when designed simple logic gate circuits. Also to answer the OP, simply read the integers into an array of integers however in this case as donald stated binary logic is read from … | |
I need a bit of clarifaction here. When you allocate memory in a dynamic memory it is depending on however you decide to increment your max of your array, so if my objective was to delete a single object in the array I would do the same as a static … | |
For the life of me I cant figure out this simple task I know with a static array you just simple shift over one element and decrease the size in variable pertaining the length of the array as such [code] for(i = 0; i < n; i++) if(key == array[i]) … | |
I have a linked list containing the following data struct node { string name; int hours; node* next; } I have all function I've made so far working, adding indiviual node, deleting node, printing data in nodes, Ive made the program to read from a file upon execution to create … | |
Re: How convient I am on the process of the same thing, Ive skimmed over it a few times, not throughly enough to learn the concept but its a decent read [url]http://richardbowles.tripod.com/cpp/linklist/linklist.htm[/url] | |
Re: Out of curiosity are you taking cmps 260? We covered this recently. I wish I could be of some solution I am just curious because I am trying to learn the same thing | |
Ok, I am trying to figure out how to purse this current project which deals with dynamic allocation and linked list Here is the information I am given the following two structs [code] struct employee { int ssn; string name; float hours; assignment * list; }; struct assignment { string … | |
Re: Your making reference to function you have not defined or you simply type in the wrong name for the header file you are typing to include that contains this functions prototype, simply your compiler cannot make reference to the function you called check your spelling on your includes | |
Re: Ok, first follow forum rules quit double posting. Second, what do you know about C++? Not anyone can jump into such a complex project such as an IM client which I am hoping will has some kind of GUI, which requires learning Windows API to make basic forms, dialogs and … | |
Re: WHAHAHWHWHAT!? Type clearly! These are babies questions...read the book and you should know how to do these...I have the very same book and I am on templates and overloading. Here you go nub [code] #include <iostream> using namespace std; //This allows std be used globally with outh prefixing std:: int … | |
I have created a insert function which inserts the item in the template array, the position of the item in the array template list is depending on the ratio of wins over total games played, I have manged to work out the insertion sort if the two scores of a … | |
I have a program that reads from a file, and inserts the read items into a template array. Once that file is read into the array the second file is read, if there is a invald name ie name not int the array it is not updated. The second file … | |
Re: Or you can use the setprecision() function of the iomanip lib. [code] #include <iomanip> . . . . cout<<setprecision(2); cout<<//output data// [/code] | |
Re: Do you have any code you worked on at all? As the rules state above this section, we help those who show work. I'll help you get started [code] #include <iostream> #include <fstrea> file input output stream library using namespace std; int main() { ifstream fin; //declare fin as a … | |
I have the following driver for my template class the parameter being passed to the template is another class, the error I get is Error line 28 : templateclass.h std::ostream<<ballteam is illegal driver.cpp line 30 Where instationating templateclass<ballTeam>::print const () driver [code] #include <iostream> #include <fstream> #include "arrayListTypeT.h" #include "ballTeam.h" … | |
Re: Provided us with the code you have already. m and s as pointers? do you mean index variables? Why would you cut a square into circles? Your analogy is very confusing seems just like to me you need to produce a matrix with 5 rows 10 columns. Clear things up … | |
Ok, I have a given template class code the only thing we are to implement is inserting an item so that the template array list is still in ascending order my template passes the parameter of another class, this classes contains overloaded operators < > == based upon the win … | |
I previously asked how to install the CC compiler earlier, I decide to share my knowledge of how this compiler instead of g++ I installed this compiler because the CC compiler can handle separate template class files. I hope this is useful to some when looking for a separate C … | |
As seen in my previous post I had a problem with some code dealing with linking a template class, I emailed my professor and the g++ compiler cannot handle the seperate compilation of template classes. So now im stuck with no compiler, in labs we use the CC compiler with … | |
I currently have a template class, another class that is passed as the parameter to the template and a driver and I am getting these errors, I have no clue what the problem is. Also I have another issue with this project I need to sort out which is insert … | |
I was given a template class code here and I have to add the code to a insert function in there, I have no real experience with templates, how would I go about doing this ? here is the template class code.cpp [code] // Implementation of the templated version of … | |
I have the following code snippet which is the most important as you can see I have two arrays defined of two different classes, my main agenda is printing them both out in a single list in ascending order based on the .GetDay value in each array, however when read … | |
Wow sorry for so many edits I just need to swap the rest of my array of structs along with the day value now delete this post or post insight on how [code] int x, y; for(x = 0; x < l; x++) { for(y = 0; y < x; … | |
I have two arrays both have a defined sized for each element that was filled when reading from a file currently but have a max size of 50 I have array 1 [4] I have array 2 [2] However, my main point is I have to process these two arrays … | |
Not necessarily hard I just have a hard time where to exactly inherit the , I have a bass class and 2 separate classes which inherit the base class Lets class base class - Class A Other two classes - Class B and Class C Class A has the following … | |
Ok I have to make a 3-D array within a class and read from a file with input like this [code] 90312 Thing_1 12.34 100 25 // Shelf 9, row 3, bin 12 20705 Thing_2 54.78 24 25 10101 Another_Thing 123.45 183 4 [/code] There array is based off 9 … | |
I am in a comp. sci course in uni. We use CentOS and the CC terminal line compiler. On my laptop I work in windows and use Dev C++, I've created a custom header file which contains a class and I want this header file to be used in a … | |
I am curious as how to install the CC command line compiler for my uni C++ projects I am not interested in g++ or gcc or whatever I want to use CC exactly so I get the desired affect of when I use it in class, however I class we … | |
Re: Im not the best by far or good but I can help with what I know... Also writing to a file and reading from a file are different steps just a little bit Ill provide both and Ill assume you have to read from a pre named file [code] //declare … | |
Ok, so I am working on a function that remove a element from the array if the name entered by a user is = to a element in the array It clears of the memory of said element but i need to re order the array I searched on here … | |
Ok, I have been busting tail trying to get this simple project done. Lesson learned is do not take a break from course work during the summer, my lack of fundamentals at this moment is tear me apart. I am determined to finish this project ahead of time to finish … | |
/facepalm Ok, so I have to make a program upon startup it has to read from a said file which looks something like this Song Name Artist Genre Track Time That is one block of the array, their is a max of 10. Ive been googling and searching the forums … | |
After being told using scanf and printf instead of cout and cin because they are treated like a function instead like cout and cin being treated as a object thus equaling faster code generation so I am relearning as a i go Can you not use a string in printf … | |
Ive used the search function just found one thing I needed more detailed help I need to a read file of float numbers no more than 100 numbers but can be less than 100 into an array I have made sample file contain 1 2 3 I have the following … | |
I have to do this user defined function return type: double parameters: one (1) type: ifstream (by reference); variable used to read the file description assume the file has already been opened successfully in main() read through the file, average the numbers and return the average to main() to be … | |
Let say I have a line for numbers 2 4 5 8 7 9 1 3 and i want to sort them in numerical order how would i do this? I found a similar topic but it was of no help someone said to do bubble sort and then everyone … | |
have to compute a function that calculates a sum in between a range let say user enters value of 10 and end value of 15 and then it is divided by a a divisor entered by the user say 2 I have the following code but its not working quite … | |
Im looking to learn more and powerful functions like winsock to use in my dev C++ programs, Im more into the field of making application like that I really would want to learn all the necessary functions in winsock to make a simple ping program, I googled and search this … | |
Tried searching but everything seems to be for VB C++. Is this even possible in dev c++ if so please tell me how to do it | |
First compute the employee's gross pay. Gross pay is hours worked multiplied by hourly rate. We will assume (for simplicity) that no employee will work more than 40.0 hours, therefore no overtime pay calculation is needed. Next, compute the net pay. To do so, we must determine the amount of … | |
I am using this if statement to formulate some sort of output however only the last block executes where each if is suppose to execute depending on the gross pay that will determine the tax. It reading input using fstream from a .txt file It reading the right numbers The … |
The End.