- Strength to Increase Rep
- +15
- Strength to Decrease Rep
- -3
- Upvotes Received
- 387
- Posts with Upvotes
- 341
- Upvoting Members
- 184
- Downvotes Received
- 25
- Posts with Downvotes
- 25
- Downvoting Members
- 15
I wear many many hats. Husband, Father, Geek, among others.I've built a couple websites and have some knowledge of HTML, CSS, JavaScript, MySQL, and PHP.I also know a little BASIC and C++.
- Interests
- Automotive (Specifically GM sports cars), Gaming, Programming (BASIC and C++), Scouting, Venturing (feel…
- PC Specs
- Win7 Pro (x86) on:Intel C2D E6600, 1GB Dual-Channel DDR400 Corsair XMS Pro (CAS 2), ATi x1650, 19"…
1,358 Posted Topics
Re: Line 32 is a function prototype, not a function call. You will have to address that issue for the function to work correctly. You will need to create a copy of that line somewhere above the beginning of your main(), then re-format that line into a proper function call. [URL="http://www.cplusplus.com/doc/tutorial/functions2/"]Have … | |
Re: :-O Seriously? Pseudocode is simply a semi-natural-language summary of the actions performed, or a simplified description of an algorithm. If you understand the C++, you should easily be able to write a summary of the program's actions. Just read through each line of the code and state what it does... … | |
Re: Have you tried to compile and run this? I can see an issue with your calls to PrintMessage(). The error I see usually would allow compilation, but cause the linker to fail. You don't need the #defines. In C++ true and false are already reserved words. | |
Re: That is what they want. But the issue is that the input has to be contiguous. Your method only works if there is some sort of whitespace between the digits. | |
Re: [QUOTE=superhero6785;1449738]Good Bye, well...I have built bots for Silkroad Online, Runescape, and Aion using another program called "AutoItV3", It is a much more simplistic language and can be considered a "Ghetto Bot" but it does take some time to learn the language such as Pixelshearching (searching the screen for certain colors) … | |
Re: [QUOTE=jdumaine;1195710]When can you use a $ in a variable?[/QUOTE] You can't. That's why it wasn't mentioned. | |
Re: [QUOTE=karthik16;1710865]1.Write a C++ function that intakes 2 arguments: a character and an integer and prints the character given number of times.If ,however, the integer is missing the function prints the character twice.[/QUOTE] Do you know how to write a for loop? Write one that uses a range of [0, counter). … | |
Re: Why? They're still relevant. Besides, you just updated it.... | |
Re: Line 43, move the "[]" after the 'j' and see what happens. The braces need to be associated with the variable name, not the dataType. | |
![]() | Re: Strictly interpreting the lab directions, you will need to use a while loop that runs as long as the condition [icode]grosssales != -1[/icode] comes true. This is called a "sentinel" value. Because you really can't have negative sales (that would then be purchasing), a more appropriate version might be based … |
Re: system(prgm); That actually calls the other program, pretty much everything else is just fluff. I'm afraid I don't know another way because I don't know Win32 API or any other APIs. I do know that this is a very insecure method though. | |
Re: [URL="http://www.cplusplus.com/doc/tutorial/functions/"]Read this.[/URL] Now, take a look at the first line of your function... [CODE]int calcDays (int)[/CODE] Anything missing? | |
Re: I'm not in robotics, so I really can't help too much. Keep an eye out for mike_2000_17, I think he's in robotics, I'm sure he'll be able to help. | |
Re: It's actually very well run. But you need to issue your request properly. If you want a post deleted, use the "Flag Bad Post" button to report it and place your request in the report. This statement/report posts directly to the moderators forum for them to more-easily see and react … | |
Re: By default, an output file opens in "truncate" mode which dumps all of the file's current contents and starts the file over. To prevent this, you need to use "append" mode. [URL="http://www.cplusplus.com/reference/iostream/ofstream/open/"]Look through this page for more info.[/URL] | |
Re: Due to how streams and the extraction operator work, you can use stream input directly in the condition of any conditional statement (such as an if or a while). Try eliminating the !cin.eof() (which tends to be a very buggy construct) as the condition and moving cin >> a >> … | |
Re: Every character in the alphabet is represented by an integer called and ASCII value. Lower-Case (minuscule) characters have higher ASCII values than Upper-Case (majuscule) characters. Relying on this fact, you can use characters directly in comparison statements to determine what actions to perform, if any. [URL="http://www.asciitable.com/"]Here is a link to … | |
Re: Distance (Pythagoras' Theorem): [TEX]c = sqrt (a^2 + b^ 2)[/TEX] Area of triangle: [TEX]( base * height )/2[/TEX] Those are a couple of the equations you'll need. The rest is just like any other program. Input, Process, Output. [CODE]int main() { return 0; }[/CODE] | |
Re: If you use a function, you only have to write the averaging code once. This will save you time and make your code easier to read. In order for the average to calculate correctly, you have to base the index you're using to access the array on the control variable … | |
Re: I haven't bothered to test this because I don't remember the correct process so I wouldn't know valid results from invalid. This concerns me though: [CODE]Permute(vector<int> set) : set(set) { Run(); }[/CODE] Do initializers automatically resolve the "this" pointer? Otherwise, this looks like a scoping issue to me. | |
Re: It is possible to have more than 1 *.cpp file in a project. In fact, for most projects, you'll want more than one. However, it looks like you have 2 different assignments/projects here. If you right-click the file for the assignment/project you don't want and choose "Exclude from project" that … | |
Re: [QUOTE=Fireprufe15;1727842]That's actually a bright idea there. If laptops and PC's could get NFC chips, you could use your NFC enabled phone to login to Windows.[/QUOTE] I don't trust RFID-based technologies. Don't get me wrong, they have a place, such as inventory tracking; but I don't think they should be used … | |
Re: [QUOTE=KazenoZ;1487315]lol, it's ok, no worries. Also, I don't really know, I don't see how these contradict eachother; the program used to compile, until I don't know what changed really, then it started giving out these errors and wouldn't compile anymore, the new project, having the files pasted into it, would … | |
Re: [QUOTE=emokidzz;1706385]sorry if i used the name of heroes in warcraft.we'll change it because our project is text-based dota[/QUOTE] The problem isn't your hero class it's the program name "Warcraft...". If Blizzard gets hold of your program, you can be sued for violating their copyright(s). Can you describe the behavior you're … | |
Re: [URL="http://www.lmgtfy.com/?q=C%2B%2B+Tutorial"]Try Googling "C++ Tutorial"[/URL]. [URL="http://www.cplusplus.com/doc/tutorial/"]This one should have been one of your top search results[/URL]. There is a multitude of Free compilers and IDEs available. | |
Re: If you already know about Data Structures, you already know more about classes than you realize. "Under the hood" a struct and a class are the same. The only major difference is that a struct has a default access level of "public" while a class has a default access level … | |
Re: [QUOTE=mikrosfoititis;1714636]what about just [ICODE]int A[a][b][/ICODE]?[/QUOTE] Unfortunately, that's not technically allowed by many compilers because a and b are not constants. Since they are not constants, they are not known and the array can't be allocated at compile time. I hear it's technically legal under newer versions of the standards, but … | |
Re: Behold the dangers of a bad naming convention! :) You should consider changing the name of "id" within this function to something more like "incomingId" or "newId" so that you don't get it confused with book::id. This also helps prevent confusing your compiler (which is possible believe it or not). … | |
Re: Any line that starts with '#' is [URL="http://en.wikipedia.org/wiki/Preprocessor_directive"]a "preprocessor directive"[/URL]. This particular one sounds like what is called [URL="http://en.wikipedia.org/wiki/Header_guard"]a "header guard" or an "inclusion guard".[/URL] It should be immediately followed by something along the lines of [CODE]#define _GLIBCXX_IOSTREAM 1[/CODE]. At the end of the file, there should also be a … | |
Re: Something doesn't match up here. You have 9 fields in your struct, but there are only 8 fields in your records. Why do you have 2 "name" fields? Once you've straightened that out, test it again then post a better description of your problem; as I'm afraid I have no … | |
Re: I've never used Allegro, but look at Line 2 of your posted errors. It says that they are "Undefined Symbols". That would indicate to me that you are calling functions without declaring them first. For example:[CODE] #include <iostream> using std::cout; int main() { int someInt = someIntFunc(); return 0; } … | |
Re: For starters, you're using out-of-date headers and you don't have any namespace resolution. The headers <stdio.h>, <stdlib.h>, <ctype.h>, <errno.h>, <string.h> and <iostream.h>. Are the old versions of the standard headers. You should use <cstdio>, <cstdlib>, <cctype>, <cerrno>, <cstring> and <iostream> respectively instead. Perhaps this will explain most of your problems: … | |
Re: Very few RNGs actually produce truly random values. The numbers are actually the result of a mathematical formula that produces a random-looking sequence of numbers. The seed tells the RNG where to start in the sequence. Your code probably works every time, but because the code executes so fast the … | |
Re: You can't define a function inside another function. Look at Lines 39 and 40. Is something missing there? This is where you main() should end, but it doesn't end until Line 84. By the way, I know that Line 84 doesn't exist, that's my point. You need to pay closer … | |
Re: The Ctrl+X key combination produces an End Of File (EOF) and associated error condition on the input stream. Figure out how to detect it and reset the stream then go from there. [URL="http://www.daniweb.com/software-development/cpp/tutorials/90228"]This thread may help too[/URL]. | |
Re: If you tell us what you expect the program to do and how what it's actually doing differs from the expected, we may be able to help you. Until you establish your intent though, we can not help you because we don't know what behavior is considered correct and therefore … | |
Re: [URL="http://www.sorting-algorithms.com/"]Here is a good place to start looking at sorting algorithms[/URL]. Being new, you'll want to study the Bubble Sort and Insertion Sort algorithms as they are the simplest to learn. Not sure if it will help or not, but here is an example Bubble Sort (in FreeBASIC):[CODE=vb] #define FALSE … | |
Re: [QUOTE][CODE]#include <iostream> using namespace std; const int NUM_TEACHERS = 3;[/CODE][/QUOTE] Other than having a generic namespace resolution, this is all good. [QUOTE][CODE]class Teacher { public: Teacher(); private: char name[40]; int teacherID; char class[20]; };[/CODE][/QUOTE] This class declaration is a decent declaration. You remembered the semi-colon at the end, that's a … | |
Re: It will also be necessary to change the <math.h> header to <cmath> and resolve the [B]std[/B] namespace by some means. Additionally, if you want to use cout, you'll need the <iostream> header. | |
Re: [QUOTE=nyuszi;1704193]here is the array: 1 42 23 14 2 23 41 15 3 63 17 18 4 3 24 15 5 32 42 13 6 34 56 78 7 22 32 4 8 35 46 3 the problem: if the last number is the lowest then l=x[i][j] and the program … | |
Re: [QUOTE=Moschops;1704265]The opinion of Stroustup pales in comparison to the actual C definition. There is no need to appeal to authority when you can read the words yourself. Section 5.1.2.2.1 of the actual C99 definition closes "or in some other implementation-defined manner" which allows for [B]void main()[/B] Here is a simple … | |
Re: I have a feeling you're getting 2 different concepts jumbled together here. Specifically, make files and Command Line Arguments (CLAs). Are these files source code that you are trying to compile into finished executable code or are they text/data files that you want to pass the names of to your … | |
Re: [QUOTE=Schoil-R-LEA;1698842]I agree with Rohan121212; you need to give more specifics about the program. The answer to the question would depend on just how the end of the loop is indicated. If you are given a number of cases to enter before the loop begins, then it is fairly straightforward: [code] … | |
Re: For starters, get rid of the "up:" label and the "goto up;" jump statement (Lines 24 and 48 respectively), they are of no use to you as that's what your do-while loop is for. Next. Please clearly explain exactly what the problem is; a statement like "I just can't get … | |
Re: [B]>>Nick, it a common convention in C++ to put statements as compound statements....Mostly to make it more compact or less complicated....So now the whole Nested if is a compound statement....[/B] Yes, it is, but there is no point in making Lines 27-32 a compound statement; it doesn't accomplish anything for … | |
Re: Why are you implementing the members of DSA_List in both DSA_list.cpp and in DSA_array.h? | |
Re: Looks like a worth while homework assignment. [URL="http://www.daniweb.com/forums/faq.php?faq=daniweb_policies"]What have you done so far?[/URL] | |
Re: I don't know anything about a "singleton pattern" but my guess is this is one part of your problem: [CODE]protected: /// Pointer to the singleton object static T* s_Singleton;[/CODE] While a protected status is less-restrictive than private. It simply means that inherited objects can now have access to it, but … |
The End.