- Strength to Increase Rep
- +5
- Strength to Decrease Rep
- -1
- Upvotes Received
- 3
- Posts with Upvotes
- 3
- Upvoting Members
- 2
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
I have always had a strong interest in computers and how applications work, so I recently took it upon myself to start learning C++, HTML, XML and JavaScript. I am still very much a beginner with programming, but I hope to really strengthen my skills…
- PC Specs
- ABS Mayhem z2: Windows XP Pro SP3 Intel Yonah 667MHz FSB 2MB L2 Cache, 1.66GHz (T1300) ATI Mobilityâ„¢…
Hey everyone, I've been working on learning the Win32 API for C++ so that I can start programming windows programs. I haven't run into any issues until last night when I tried to include a menu in my basic window through resources. I'm using Visual C++ Express 2010 which doesn't … | |
Re: pecet is correct. Also, don't forget to #include <ctime> so that you can use the time() function. -D | |
Hey all, I am currently working on building a small text-based RPG to practice C++. I am working on a function to load a saved game from information saved in a text file. Below is the code for the function: [code=cplusplus]void getSavedGame(playableCharacter& player1) { int stamina, health, mana, level, strength, … | |
Re: First, please use code tags for your code. Second, place [code=cplusplus]cin.get();[/code] right before return 0 in your main. That will hold the console window open until the user presses enter. Also, why do you have your drawbar function returning an integer? It seems like it should be a void function... … | |
Re: [QUOTE=crazyboy;1031790]for Ans [a] :: - line 1 line 3 line 4 fro ans [b] :: - CC() { u = 0; v = 0; } for Ans [c] :: - CC(int i) { u = i; v = 0; }[/QUOTE] Don't just give out homework answers. Ask the person what … | |
Re: Hello kadji.kahn, I agree with everything that Sky Diploma said. In addition, you can shorten up your function a bit. This is what you currently have: [code=cplusplus]int average(int a, int b, int c, int d, int e) { int daverage; daverage = (a+b+c+d+e) / 5; return daverage; } //end average … | |
Re: It also appears that you have incorrect ranges for your letter grades (which gurudevashu has fixed in his revised code above): [code=cplusplus] else if (c >=79 && c <=70) {cout <<"C" << endl;} else if (c >= 69 && c <=60) {cout << "D" << endl;} else if (c >= … | |
Hello all, I am in the process of teaching myself CSS to go along with my beginner-intermediate knowledge of HTML. I am just starting with CSS and have created a small test file to attempt to create a table with one row and one cell in that row. I then … | |
Re: Hello tomtetlaw, As JugglerDrummer mentioned above, you would use the member access operator "." For more information on the operator and structures in general (including pointers to structures and the member access operator through a pointer "->") you should take a look at the following website: [url]http://cplusplus.com/doc/tutorial/structures/[/url] -D | |
Re: Hello arelius, I would suggest the following tutorial: [url]http://www.cplusplus.com/doc/tutorial/[/url] I starting learing C++ off of here before going and reading some books on it. As for practice problems, there is a section on this forum for them: [url]http://www.daniweb.com/forums/thread67837.html[/url] Hope that helps. -D | |
Re: Hi blahbla, It seems to me that your best bet would be to create a new variable before you start your loop that you use to add all of your random numbers together. I would suggest doing the addition right before the end of your for loop so that every … | |
Re: Hey, I'm still pretty new to C++, but there are a few comments that I would make regarding mystuff.cpp: 1. You will want to inlude the <ctime> header as that contains the time function you use for seeding your random number generator. 2. It may serve you better for your … | |
Re: Hey rajesh.hck, I am also pretty new to programming and I downloaded Microsoft Visual C++ 2008 Express (it's free) and I like it very much. If you've already downloaded codeblocks from the link above then that should work fine as well, but my preference is for Visual C++ (I just … | |
Re: You have already started a thread with the exact same name as this one where people are trying to assist you: [url]http://www.daniweb.com/forums/thread223471.html[/url] Why did you start a new one? If you are done with the old one, mark it as solved so that you don't have users continuing to post … | |
Re: I have been watching your theads for the last few days, and you really do need to sharpen up and use the great advice that these guys have given you. Throughout your theads you have been given a lot of useful information that you should have incorporated in your program … | |
Hey guys, I am still pretty new to C++ and am completely self-taught up to this point. I am currently learning about try, throw, and catch statements for exceptions and am trying to incorporate this into my programs. I know that normally when you allocate new dynamic memory, if the … | |
Re: Basing the code off of what firstperson has above, if you want to loop the program, you could use a while loop like so: [code=cplusplus]#include <iostream> using namespace std; int main() { int x=0; float a,b; while(x != 7) { cout << "Hello, please pick a type of problem from … | |
Re: In this particular thread that VernonDozier posted above: [url]http://www.daniweb.com/forums/thread214101.html[/url] look at post # 12 by Ancient Dragon where he gives you two possible explanations as to how you could go about creating a delete function. I'm not a betting man, but I'm willing to bet that if you look at … | |
Re: While I am still new at C++, it seems to me that for your GetEmployeeRec function, you're going to want to pass your EmployeeRec objects to the function as references. i.e.: [code=cplusplus]getEmployeeRec(EmployeeRec& A, EmployeeRec& B)[/code] That way the function can directly manipulate the members of your objects. Also, you have … | |
Hello All, I am still pretty new to C++ and am just trying to create simple codes to strengthen my skills. I have written the code below that is supposed to allow the user to pick a shape (either circle, square, or rectangle) and then input either the radius or … | |
Re: I'm still pretty new at C++, but try passing your argument by reference instead of pointer: [code=cplusplus]void foo(int &x) { int y = new int(999); x = y; }[/code] Passing arguments by reference should allow the function to directly manipulate that variable without the need for a return statement. I … | |
Re: Hey, First off, please use code tags when displaying code as it will make it much easier for everybody to read. I have looked through the code you have so far and it looks pretty good, but I have made a few changes for the sake of functionality and the … | |
Re: In order to allow the user to enter new data or quit, you will want to place all of your code after your variable declarations in a while loop. That way, the user can go through the program as many times as he or she wants: [code=cplusplus] #include <iostream> #include … | |
Re: Hello CD-4+, While I am still pretty new to C++, I believe that the compiler error that you are receiving is due to the fact that you have a semi-colon in your class definition of the meow() function: [code=cplusplus]# include<iostream> using namespace std; class cat { public: int age; int … | |
Re: Hey guys, If I'm understanding your problem correctly, then it seems to me like you want the program to look similar to the following outline: [code=cplusplus]#include <iostream> using namespace std; int main(void) { int nUserNum; //set the next variable equal to 1 so that if the user enters //only one … | |
Re: [code=cplusplus] #include <iostream> using namespace std; int main() { int adults; int children; int total_amount; cout<<"Press return after entering a number .\n"; cout<<"Enter the number of adults :\n"; cin>>adults; cout<<"Enter the number of children :\n"; cin>>children; { if (adults + children > 50); "warning to cashier\n"; total_amount = (adults * … | |
Re: You also may run into a problem because you have the variable first declared as a double but set it equal to the function one which returns an integer: [code=cplusplus]int one (int x, int y); double dec, a, first; first = one (6, 8); [/code] -D | |
Re: Agreed, the threads at the top are a good start. I am a beginner as well, and I started with the following items: C++ For Dummies (updated for 2009)(I just went to Barnes and Noble or Borders and read a chapter a day) [url]http://www.cplusplus.com/doc/tutorial[/url] Hope that helps. -D | |
Hello all, I am in the process of teaching myself c++. I wrote one program successfully and I'm trying to write my second. I have run into a problem that I can not seem to figure out at all. I understand that this seems trivial, but I really need to … | |
Hey all, I know this is a very newbish questions, but I couldn't readily find the answer on this board so I figured I would ask. Consider the following code snippet: [code=cplusplus] for(i=0;i<5;i++) { int number; int counter; cout << "Enter a number less than 10:" << endl; cin >> … |