Forum: C++ Mar 29th, 2005 |
| Replies: 45 Views: 44,392 Hello,
I see a problem with the following code:int main(void)
{
myfunction(argument1, argument2);
int argument1 = 4, argument2 = 5;
return 0;
}Simple. You create your variables after you... |
Forum: C++ Mar 11th, 2005 |
| Replies: 11 Views: 23,184 Hello,
You may want to try:// my first program in C++
#include <iostream>
using namespace std;
int main (void) {
// Display text
cout << "Hello World!" << endl; |
Forum: C++ Mar 10th, 2005 |
| Replies: 45 Views: 44,392 Hello,
ยป One aspect of C functions may be unfamiliar to programmers who are used to some other languages, particularly Fortran, is Call by Value. In C, all function arguments are passed "by... |
Forum: C++ Mar 10th, 2005 |
| Replies: 11 Views: 23,184 Hello,
I would recommend Bloodshed Dev-C++ (http://www.bloodshed.net/devcpp.html) for C++ programming.
If you want to compile C code, I would suggest using a C compiler such as GCC. I'm... |
Forum: C++ Mar 10th, 2005 |
| Replies: 1 Views: 4,693 Hello,
I'm not very fluent in Win32 programming, though I might be able to point you in the right direction. Below are a list of links that may help you:
A checkbox tree control for use in... |
Forum: C++ Mar 9th, 2005 |
| Replies: 9 Views: 3,279 Hello,
Attached is a modified version of your main file: main.cpp
My workspace contains 1 Source File, main.cpp, and 1 Header File, free_list.h.
- Stack Overflow |
Forum: C++ Mar 8th, 2005 |
| Replies: 9 Views: 3,279 Hello,
An unresolved external occurs when some code has a call to a function in another module and the linker can't find that function in any of the modules or libraries that you are currently... |
Forum: C++ Mar 8th, 2005 |
| Replies: 9 Views: 3,279 Hello,
I have viewed and compiled the source files without warnings or errors with Visual C++ .Net 2003. I did not see main() declared in either of your two files, as I added it manually during my... |
Forum: C++ Feb 23rd, 2005 |
| Replies: 8 Views: 5,466 Hello,
C provides the infinitely-abusable goto statement, and labels branch to. Formally, the goto statement is never necessary, and in practice it is almost always easy to write code without it.... |
Forum: C++ Feb 8th, 2005 |
| Replies: 0 Views: 1,722 Hello,
Brief Tutorial Revision: All examples can be compiled successfully in your compiler. Also, each example is compatable using the -Wall, -pedantic, -ansi, and -std=c89 GCC flags. Also, a few... |
Forum: C++ Dec 13th, 2004 |
| Replies: 8 Views: 2,864 Heh,
Very funny prog-bman. :)
As for you Nabs, the definition of your nick is intriguing: Apprehend
Google (http://www.google.com), not Giggle, is your friend believe it or not. Just do... |
Forum: C++ Nov 10th, 2004 |
| Replies: 2 Views: 1,560 Greetings,
There are a few syntatical errors in your program. Let's walk through them one step at a time.
Point A
First issue is the local variables themselves. Nothing major, it can be fixed.... |
Forum: C++ Nov 10th, 2004 |
| Replies: 2 Views: 2,539 Greetings,
A simple fix I saw. In your function gettemps() change:scanf("%f",temp[i]);To"scanf("%f",&temp[i]);if If you want to store the result of a scanf operation on a standard variable you... |
Forum: C++ Nov 9th, 2004 |
| Replies: 5 Views: 27,016 Greetings,
Thinking on the same line, lets walk along the string. Better yet, lets use a while loop to do so. By creating a seperate function to modify the string would probably be beneficial in... |
Forum: C++ Nov 3rd, 2004 |
| Replies: 36 Views: 11,742 Greetings,
Creating an inline function to return the average of a group of numbers is not difficult. In this case, we will take all the values of the array and average them. The algorithm to... |
Forum: C++ Nov 2nd, 2004 |
| Replies: 3 Views: 2,243 Greetings,
How about if we try this:int main() {
udate d1;
cout << "PROGRAM FOR FINDING THE NEXT DATE USING OPERATOR OVERLOADING '++'" << endl << endl;
while (1) {
cout << "ENTER THE... |
Forum: C++ Nov 2nd, 2004 |
| Replies: 4 Views: 5,839 Greetings,
The algorithm may be off in some ways. I put some prints in the code to see what was failing or skipping and nothing showed up. Firstly the reason that your check of (x<s) will never... |
Forum: C++ Nov 2nd, 2004 |
| Replies: 36 Views: 11,742 Greetings,
This is possible to do. You can just call inside your if statement to a function you manually create. You could call it calculateRect(). What it will do is take your variable answer,... |
Forum: C++ Nov 2nd, 2004 |
| Replies: 3 Views: 2,243 Greetings,
There are a few typographical and syntax issues with your program. Firstly, lets look at the minor issues:
Point Aint valid(update D)I'm guessing that update should be udate, hence... |
Forum: C++ Nov 2nd, 2004 |
| Replies: 9 Views: 49,571 Greetings kisseric,
Try changing the line:if (newEntry == 0)
{
doDivideZero(double &);
}To:if (newEntry == 0)
{
doDivideZero(displayedVal);
}Once I did this, your program ran just fine. I... |
Forum: C++ Nov 1st, 2004 |
| Replies: 4 Views: 2,056 Greetings kisseric,
Welcome to DaniWeb. Gain help, Gain trust. :) Enjoy!
- Stack Overflow |
Forum: C++ Oct 27th, 2004 |
| Replies: 4 Views: 3,896 Ah, Simple.
We would have to break this up into different pieces of code. The first piece would be:for(row=0;row<12;row++)
for(col=0;col<6;col++)
initialize[row][col]='*';The reason we don't... |
Forum: C++ Oct 27th, 2004 |
| Replies: 4 Views: 3,896 Greetings,
This can be fixed quite easily. Array subscripts always start at zero in C, so elements are initialize[0], initialize[1], ..., initialize[11]. Meaning, you cannot write to the array... |
Forum: C++ Oct 27th, 2004 |
| Replies: 7 Views: 2,918 Well,
kakilang's for loop looked like:for(int i = 24; i >= 0; i--)While yours looks like for(int i = 0; i <= size; i++)The difference is that you start at 0 [the beginning] and looping until the... |
Forum: C++ Oct 27th, 2004 |
| Replies: 2 Views: 2,954 Greetings lvdude,
Doing this is not hard. There is a simple approach to this.
Understanding that you are talking about Windows, hence the "Registry", it is not hard to check for a key and its... |
Forum: C++ Oct 26th, 2004 |
| Replies: 7 Views: 2,918 Greetings bryan7890,
Do you want to print those numbers in reverse order as in starting at the last array and read until the first, or are you trying to sort the array to ascend or descend... |
Forum: C++ Oct 26th, 2004 |
| Replies: 36 Views: 11,742 Greetings,
The few syntax errors are easy to fix. Let's go through them one step at a time.
Point A
You include iostream which is a Standard ISO C++ header. Standard library facilities are... |
Forum: C++ Oct 21st, 2004 |
| Replies: 2 Views: 8,024 Greetings,
The reason you are experiencing this problem is because fstream's open() command takes a "char *" paramater, not string.
open()
void open(const char *filename, openmode mode = in |... |
Forum: C++ Oct 21st, 2004 |
| Replies: 1 Views: 3,052 Greetings dcving,
Fixing this issue is quite simple. Let me expound.
By using setprecision, you asked for two places, and it printed two places. If instead you want two decimal places... |
Forum: C++ Oct 20th, 2004 |
| Replies: 2 Views: 6,489 This is a section for posting complete and detailed tutorials regarding the C / C++ language.
This is not the place to post questions regarding the framework and design of the source code of your... |
Forum: C++ Oct 20th, 2004 |
| Replies: 2 Views: 15,431 Greetings,
I did notice a few typographical syntax errors, and a node system error. Let's start off with the syntax errors, as they are easy to fix.
insertNode()
Taking a look inside your... |
Forum: C++ Oct 20th, 2004 |
| Replies: 7 Views: 1,875 Greetings,
Sorry for not being clear when explaining what my three dots meant in my example. I meant to continue on, like to code something to this similar event:switch (input) {
case '1':
//... |
Forum: C++ Oct 19th, 2004 |
| Replies: 7 Views: 1,875 Glad to be of assistance,
> my current program does not allow me to ask date.
After you call "cin >>" some programs don't respond exactly to wait for the next input. Usually you have to call... |
Forum: C++ Oct 19th, 2004 |
| Replies: 9 Views: 2,838 Alright,
Down to the last function in your class to make is ShowDate()
This function will take the year, month, and date from your class and build text to display. Before we move onto creating... |
Forum: C++ Oct 19th, 2004 |
| Replies: 9 Views: 2,838 Greetings,
It is compilers fault for making the the screen say "press any key to continue" and then close. Your main() declaration is fine, though before you "return 0;" you may want to put in... |
Forum: C++ Oct 19th, 2004 |
| Replies: 9 Views: 2,838 Greetings wangstarr,
The following error simply means you have no main() in your source code:
error LNK2001: unresolved external symbol _main
It is simple to fix, just add somewhere in your... |
Forum: C++ Oct 18th, 2004 |
| Replies: 9 Views: 2,838 Greetings,
Looking through your statement, I did notice the "Use a private member function to set the month name based on the month number" quote.
Let's disect this statment, as it holds the... |
Forum: C++ Oct 18th, 2004 |
| Replies: 1 Views: 1,747 Greetings,
Looking throughout your code, you leave it somewhat impossible to allow a tryAgain() function work. As, lets say, getEmployeeData() takes 6 parameters; all of which are local variables... |
Forum: C++ Oct 18th, 2004 |
| Replies: 7 Views: 1,875 Greetings,
> what can I do so that No negative balances should be entered?
Well, this is a simple task, and your code shown should indeed work. Though, you would call on this after the "cin >>".... |
Forum: C++ Oct 18th, 2004 |
| Replies: 1 Views: 4,404 Greetings,
Through a long debug session, I have discovered why your array seems to zero out. Let's just say, its nothing new ;) Personally, it was the unionOfIntegerSets() and... |