Forum: C++ 8 Days Ago |
| Replies: 7 Views: 226 well your could use cout.width() function..... with an argument. to set up the allignment |
Forum: C++ 9 Days Ago |
| Replies: 9 Views: 208 apart from what A.D said, to get a little technical, you may want to try the peek() function. Check if that character is an alphabet or a number. if its a number . take in the number with the >>... |
Forum: C++ 9 Days Ago |
| Replies: 6 Views: 187 Well firstly you will need a database or a particular condition to determine the age of the person with the ID card number.
If this is a project for you ..... read through the material to get the... |
Forum: C++ 9 Days Ago |
| Replies: 7 Views: 226 The Prime testing method is absolutely mis-interpreted.
http://www.daniweb.com/forums/thread233963.html
Here is a recent prime number test code. Try to change it such that it matches your... |
Forum: C++ 9 Days Ago |
| Replies: 11 Views: 268 Or another thing you can do is to call the grade function from Average (). |
Forum: C++ 11 Days Ago |
| Replies: 8 Views: 197 Post down your current code. This forum has a rule that we cannot give homework help until you show your effort. :) |
Forum: C++ 11 Days Ago |
| Replies: 8 Views: 359 This is perfectly right !! Nice, work figuring out the suggestion of FirstPerson . |
Forum: C++ 12 Days Ago |
| Replies: 6 Views: 191 Yes, its a mere notational advantage .
This applies to both for loops and if statements.
If the curly braces { } are absent. the loop only executes the next line.
for(j=2; j<=i/2; j++)
... |
Forum: C++ 12 Days Ago |
| Replies: 6 Views: 191 Well this program is not as complex as it seems to be.
for(i=1; i<=100; i++)
The first for loop runs from 0 to 100, and runs a test for checking whether its prime or not.
Then in the... |
Forum: C++ 12 Days Ago |
| Replies: 7 Views: 190 Well, what dkalita means is that.... no value is assigned to the variables. givenFirst and givenLast.
Apart from that there are many other mistakes in your program.
Firstly, the declaration... |
Forum: C++ 12 Days Ago |
| Replies: 5 Views: 201 I wonder if it is compulsary to use new to allocate variable space. Since it is only one. Why dont you just declare a variable. That way you will not need to worry about deleting. as the Destructor... |
Forum: C++ 13 Days Ago |
| Replies: 9 Views: 180 well you could use the logical && to join up checking for all !! and use one if statement only! |
Forum: C++ 13 Days Ago |
| Replies: 9 Views: 180 Do you know how to use arrays? If you are comfortable with arrays, try using them to replace the different mark variables.
Btw, this program doesn't check if the other variables apart from f, have... |
Forum: C++ 15 Days Ago |
| Replies: 4 Views: 106 Well is it that you want the value of the variable to be changed at run-time or during compilation. |
Forum: C++ 15 Days Ago |
| Replies: 4 Views: 331 http://www.daniweb.com/forums/announcement8-2.html
The answer to all your so called queries!! |
Forum: C++ 15 Days Ago |
| Replies: 1 Views: 112 Add the 10 totals value to derieve a FULL SALES value, That Sales divided by 10 would give you the Average. What you can do is store the totals in the array, then compute the Average. And then... |
Forum: C++ 16 Days Ago |
| Replies: 6 Views: 229 cout<<strupr(s[0]);
This Does Not Work . Because strupr() takes a char* as an argument. So the argument should be a sting having a null character ie: '\0' at the end. But you give a character as... |
Forum: C++ 16 Days Ago |
| Replies: 4 Views: 188 I really wonder if that's possible..
What you are trying to do is to make an executable without actually compiling the C++ syntax.
Without the compiler, I think that the C++ syntax would be juz... |
Forum: C++ 18 Days Ago |
| Replies: 6 Views: 171 I agree that this makes it more efficient . My only approach was to exhibit what the OP was trying to do, with a for loop!! |
Forum: C++ 19 Days Ago |
| Replies: 8 Views: 288 Please post your existing code and the updates that you have done. So it will be easier to come up with an answer. And also tell us which forloop to avoid. |
Forum: C++ 19 Days Ago |
| Replies: 3 Views: 243 Remove the declaration of the variable int i=0; from line 14 and place it in between 33-34 or 34-35.
The problem is that the scope of the variable which retains the value of 11 after the first... |
Forum: C++ 19 Days Ago |
| Replies: 2 Views: 163 Ok, I would currently say that your solution is INCOMPLETE, But it doesn't suck!! :)
Though I will not completely give you the solution, here are a few tips on getting to the right path.
... |
Forum: C++ 19 Days Ago |
| Replies: 6 Views: 171 Firstly, I would like to point out to you that your code is actually assigning values but not comparing them.
[while(g[0] = 0 || g[0] = 1 || g[0] = 2 || g[0] = 3 || g[0] = 4 || g[0] = 5 || g[0] = 6... |
Forum: C++ 19 Days Ago |
| Replies: 4 Views: 203 Well the thing is that, You get to know if a certain number is prime .. After you have checked it with all the numbers. But here .. You are checking it with each number and then printing them up. So... |
Forum: C++ 29 Days Ago |
| Replies: 2 Views: 235 Have fun implementing it !! (http://www.daniweb.com/forums/announcement8-2.html)
WE DONT GIVE HOMEWORK HELP IF YOU DONT PUT IN EFFORT.
Write some code and then get back to the site to clear... |
Forum: C++ 33 Days Ago |
| Replies: 21 Views: 601 Well its pretty unclear for me to understand this, Please Post down the Input , Desired Output and Current Output. That way it would be easy. |
Forum: C++ 33 Days Ago |
| Replies: 4 Views: 282 Well, Instead of criticizing our so called criticizm. Why dont you use a for loop to take in input .. And While you are at it. try to use cout and cin as printf and scanf are Considered as 'C'... |
Forum: C++ 34 Days Ago |
| Replies: 5 Views: 201 Well, we appreciate that you are trying to put-in effort. But We would require you to make an attempt at cracking the solution yourself. Then when you have an attempt, we could then come in and get... |
Forum: C++ 34 Days Ago |
| Replies: 21 Views: 601 Shoudnt Line 12 be
the reverse newNode->info=i->info;
And could you explain what line 15 is doing? |
Forum: C++ 34 Days Ago |
| Replies: 4 Views: 282 I would say that this is supposed to be a C question and even that it is poorly written. Whats your question ? |
Forum: C++ 34 Days Ago |
| Replies: 5 Views: 201 Firstly you are looking at different operations.
1) Maintain A Database, That's pretty much done, when you have a excel spreadsheet which you can later convert into CSV (Comma separated Value )... |
Forum: C++ 34 Days Ago |
| Replies: 21 Views: 601 If both are of type string, you could just use the "=" operator and completely avoid strcpy. |
Forum: C++ 34 Days Ago |
| Replies: 3 Views: 87 http://www.eternallyconfuzzled.com/tuts/languages/jsw_tut_pointers.aspx
This link would also help you understand the pottential of Pointers. |
Forum: C++ 34 Days Ago |
| Replies: 6 Views: 240 Post down the total code so its easier to troubleshoot. |
Forum: C++ 34 Days Ago |
| Replies: 21 Views: 601 I dont understand why cant you use.
tempword=i->info; |
Forum: C++ 34 Days Ago |
| Replies: 21 Views: 601 for(int i = first; i->link != NULL; i = i->link)
Check Line 4 in the code in your post. it consists the above code.You have declared variable i to be of type int then you use the -> operator .... |
Forum: C++ 34 Days Ago |
| Replies: 6 Views: 240 A google search before posting always helps.
Anyways check this code out.
http://forums.devx.com/showthread.php?t=154478 |
Forum: C++ 34 Days Ago |
| Replies: 4 Views: 282 Well in your question. You said that you need to use arrays. But You are not using any in your program. The best approach would be to analyse the question and think how you can use a index to get the... |
Forum: C++ Oct 2nd, 2009 |
| Replies: 4 Views: 246 Yes, Btw, Dont forget deleting each one of the dynamic pointers . Before you delete the pointer to pointer.
And yea, Loops could assign values.
Another solution would be to use vectors. |
Forum: C++ Oct 2nd, 2009 |
| Replies: 4 Views: 246 Well Dynamic 2D arrays take a little more complexity.This is mainly because when you declare something like this
int *p;
p= new int [2][2];
What you are trying to do is assigning a pointer... |