Forum: C++ Jan 14th, 2009 |
| Replies: 6 Views: 412 This is the wrong forum for your code. There's a dedicated forum for C++.
daysincalendaryearpriortocalendarmonth +=31; daysinwholeyearssince1800 += 366;
what's in those variables before you add... |
Forum: C++ Jan 14th, 2009 |
| Replies: 6 Views: 412 Could you post what you have done so far? In that way we'll know at what level you are at learning, and tailor a help for you.
Make sure you read the proper way of tagging code before hand. |
Forum: C++ Oct 19th, 2008 |
| Replies: 5 Views: 885 Would that help?
http://www.winprog.org/tutorial/start.html |
Forum: C++ Oct 3rd, 2008 |
| Replies: 11 Views: 946 Ten days...? You should be an expert of the language by now. Specially, when there are incredible books for mastering programming in just twenty-four hours.
Just kidding. ;)
You are welcome. ... |
Forum: C++ Oct 3rd, 2008 |
| Replies: 11 Views: 946 >please help me how to do this?, sorry if it kind of silly, cause I have just studied C++ for 10 days...
I am trying but I can not read your mind, and all that I have is your code which it doesn't... |
Forum: C++ Oct 3rd, 2008 |
| Replies: 11 Views: 946 And what you want is something like theses, right?
**
* *
* *
**
/ \
/ \
/ \
_ _ _ _ |
Forum: C++ Oct 3rd, 2008 |
| Replies: 11 Views: 946 >if we don't use cin.get . How can we keep the program so that we can see the result, it will run really quick.
That's not what I said. But since you ask me there's always the ability of running it... |
Forum: C++ Oct 3rd, 2008 |
| Replies: 11 Views: 946 Nope, it does exactly what you program to do.
Delete all the cin.get() inside the functions, and call them if you want after it draws each figure inside of main. Then take a look again. |
Forum: C++ Oct 2nd, 2008 |
| Replies: 10 Views: 845 A comment if I may bhoot_jb.
You make heavy use of [..]. I know what ellipsis are [...], but I can't figure what's the process that warrant the use of two consecutive periods.
What's the... |
Forum: C++ Oct 2nd, 2008 |
| Replies: 10 Views: 845 If you don't want to exit don't use the function exit() which will terminate the program.
sentinel set to not done
while not done:
menu options:
switch:
option 1:
... |
Forum: C++ Oct 1st, 2008 |
| Replies: 10 Views: 845 Perhaps consider a menu using a switch (http://www.cprogramming.com/tutorial/lesson5.html) case construction? |
Forum: C++ Aug 30th, 2008 |
| Replies: 2 Views: 589 first declare an array of integers
int ar[100];
second use it inside the loop
for(int i=0; i<100; i++)
{
ar[i] =(rand()%100);
cout<<ar[i]<<" ";
} |
Forum: C++ Aug 11th, 2008 |
| Replies: 1 Views: 388 You forgot to tell us how soon do you need it?
Click me. (http://www.daniweb.com/forums/announcement8-2.html) |
Forum: C++ Aug 11th, 2008 |
| Replies: 10 Views: 2,187 knock yourself out. (http://www.google.com/search?hl=en&q=linux+check+if+a+file+exist+in+C%2B%2B&btnG=Google+Search) |
Forum: C++ Jul 29th, 2008 |
| Replies: 14 Views: 1,720 Look here (http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1042856625&id=1043284385)
Those are called preprocesso (http://www.cprogramming.com/tutorial/cpreprocessor.html)r directives. |
Forum: C++ Jul 28th, 2008 |
| Replies: 14 Views: 1,720 You have prototyped the void function(); in the header file, but nowhere you have defined function(). How does the compiler know what it does? |
Forum: C++ Jul 28th, 2008 |
| Replies: 14 Views: 1,720 Some reading examples here (http://en.wikipedia.org/wiki/Header_file), here (http://gcc.gnu.org/onlinedocs/gcc-4.3.0//cpp/Header-Files.html) and here... |
Forum: C++ Apr 22nd, 2008 |
| Replies: 4 Views: 2,320 Here's a visual help (http://www.augustcouncil.com/~tgibson/tutorial/ptr.html) to understanding pointers |
Forum: C++ Sep 5th, 2007 |
| Replies: 10 Views: 1,371 cout<<unsort[i]<<" ";
cout <<unsort[y]; These are not valid C programming statements. |
Forum: C++ Jul 9th, 2007 |
| Replies: 62 Views: 11,179 !!!!! WARNING YOUR COMPUTER MAY BE INFECTED WITH SPYWARE!!!! PAY AN OVER PRICED AMMOUNT TO HAVE SOMTHING FIXED WE PLACED THERE IN THE FIRST PLACE!!!!!!!!!
sound familiar, know how to block... |
Forum: C++ May 16th, 2007 |
| Replies: 3 Views: 15,555 My friend, I think you are assuming too much of that if statement. What if the entered input is a space or a new line or " ?. Would that be considerate a letter?. |
Forum: C++ May 14th, 2007 |
| Replies: 7 Views: 2,760 Dev C++ doesn't know about #include < conio.h>
getch() is why conio.h is needed.
change getch for getchar and it will not complain. You do not need conio.h. |
Forum: C++ May 12th, 2007 |
| Replies: 1 Views: 1,970 Your question will be answer shortly. In the meanwhile please do
read this short guide (http://www.daniweb.com/techtalkforums/announcement8-3.html) on how to tag your code properly. |
Forum: C++ May 11th, 2007 |
| Replies: 5 Views: 2,287 Can you use putchar() and display each character one at a time? |
Forum: C++ May 11th, 2007 |
| Replies: 9 Views: 1,267 Maybe he just need a little TLC. |
Forum: C++ May 11th, 2007 |
| Replies: 9 Views: 14,056 Does it work in C++ like this?:
if( *temp_ptr == 0 ) {} |
Forum: C++ May 10th, 2007 |
| Replies: 3 Views: 3,870 If all that you are going to do is to use C++ to
make calls to commands to the CLI , why don't
you just make a script in bash with those commands?. |
Forum: C++ May 3rd, 2007 |
| Replies: 13 Views: 3,081 My apologies. You are correct. I don't know what I was thinking. |
Forum: C++ May 3rd, 2007 |
| Replies: 13 Views: 3,081 >while(grade[i] < 0.0 || grade[i] > 4.0) Change to while( grade[i] < 0.0 && grade[i] > 4.0) |
Forum: C++ Apr 29th, 2007 |
| Replies: 3 Views: 1,007 Is you question what is it and how it works?. Look for the modulus operator. |
Forum: C++ Apr 26th, 2007 |
| Replies: 16 Views: 3,295 Going back to my switch example:
#include <stdio.h>
int main(void)
{
int fuel;
int c;
printf ("State your fuel use or way of travel\n"); |
Forum: C++ Apr 25th, 2007 |
| Replies: 16 Views: 3,295 Every time you use scanf() to read input, it leaves at least as a minumus the ENTER key in the stdin buffer. Learn to use fgets() to read input.
To make your code work for now, after every scanf()... |
Forum: C++ Apr 25th, 2007 |
| Replies: 16 Views: 3,295 >i cant seem to get the worked out value printed in the switch.
Do you mean something like this?:
case 1:
printf("you are using $%f in petrol\n", (float)fuel * 2.3); |
Forum: C++ Apr 25th, 2007 |
| Replies: 16 Views: 3,295 Considere a switch expression for your code.
#include <stdio.h>
int main(void)
{
int fuel;
printf ("State your fuel use or way of travel\n"); |
Forum: C++ Apr 25th, 2007 |
| Replies: 16 Views: 3,295 void Petrol();
void Oil();
void Coal();
void Wood();
void Electricity();
void Naturalgas();
I read your prototypes: void Petrol(); void Oil(); void etc..., and had
a laugh, I wish my house... |
Forum: C++ Apr 25th, 2007 |
| Replies: 16 Views: 3,295 Is not only fuel == "Petrol" the once with problems.
You are trying to compare the value of an integer `fuel' with an array of characters. All the if that you have with strings will give you an... |
Forum: C++ Apr 16th, 2007 |
| Replies: 3 Views: 1,045 This is an error. Most like it you want !=
LPT1 is suppost to be a file open already and declared. Compiler
do not have knowledge of what LPT1 is. |
Forum: C++ Apr 16th, 2007 |
| Replies: 8 Views: 3,804 So I always got it wrong (opposite) in my mind.
Thank you very much. |
Forum: C++ Apr 16th, 2007 |
| Replies: 8 Views: 3,804 Let's see if I finally get this correct for once:
int array[3];
array[0]
array[1]
array[2]
array[3]
Four elements in an a single dimention array. |
Forum: C++ Apr 16th, 2007 |
| Replies: 8 Views: 3,804 Isn't an array of 3 integers of 4 elements each? |