1,288 Posted Topics
Re: Ignore this one. | |
Re: I'm not sure that code can prove it; you're asking the machine to deal with numbers to infinite precision. As soon as you start hitting floating point limits, you can no longer trust the numbers. | |
Re: No great trick to it; you just have to think about how you'd do it yourself and then turn that into an algorithm. Something like: 1) Start looking at string, one character at a time. Start at end of string and work backwards, so that you'll know when you're scanning … | |
Re: [B]p=talloc();[/B] According to the forward declaration, talloc returns a pointer to a node, but p is a pointer to a tnode. [B]treeprintf(p->right);[/B] No such function named treeprintf [B]struct tnode *talloc(void)[/B] Disagrees with the previous forward declaration, [B]struct node *talloc(void);[/B] Essentially, all your errors are typing mistakes. | |
Re: You've got the logic wrong. In your code, your [B]for [/B]loop does not do any checking of the numbers. It just creates a big value for sum. [I]Then [/I]your [B]if [/B] statement checks that one big sum value against 28, and then goes back to [B]loop:[/B] because whatever that big … | |
Re: [QUOTE]fatal error C1075: end of file found [B]before the left brace '{'[/B] at 'c:\users\kamron\documents\visual studio 2010\projects\number guess\number guess\guess.cpp(11)' [B]was matched[/B][/QUOTE] See those left braces you have? All the things that look like this: { Each one of those should have a matching right brace: } They don't. | |
Re: Also, you can use the [B]nm[/B] executable on an object file (or an executable) and it will give you a list of functions. If main is in there, you'll see it. This does of course require you to be using an OS that comes with [B]nm[/B], or has [B]nm[/B] or … | |
Re: [QUOTE]I doubt the "pros" use geometric primitives, lol. [/QUOTE] What else are they going to use? They might package them up first into files and objects, or write functions to abstract some of the grunt work, but they're still there. Here's a page explaining how someone read a 3DS file … | |
Re: This line, a few lines before line 76 in the listing above: [B]return gcf(gcf2, gcf1 % gcf2);[/B] I suspect that this is the erroneous line. Given that gcf, gcf1 and gcf 2 are all [B]int[/B], this doesn't make a lot of sense to me. I'm not familiar with .NET (and … | |
Re: Your syntax is unfortunately wrong, and is not C++. A long time ago, before C++ was standardised, it was just questionable, but now it's wrong. [B]main()[/B] is wrong. [B]int main() [/B]is correct. [B]#include<iostream.h>[/B] should be [B]#include<iostream>[/B] [B]cout<<"Simply insert a number(in integer): ";[/B] This should not work, as [B]cout [/B]lives in … | |
Re: Which line is the error on? As an aside, this looks like C#, so if you don't get the answer you need here, consider posting there. | |
Re: Exactly. The digit "8" does not exist in octal. The digits "1", "2", "3" and "4" do exist in octal. | |
Re: I compiled your code and ran it; I got this output: [B]Enter the number of students to be registered: 3 Enter the student number: #21 Enter the number of modules, student #21 would like to register for: 1 Enter the number of modules(from min:2 to max:5), student #21 would like … | |
Re: I see you've put the logon name and password for this ftp site into the public domain. I recommend you change the password and check to see what people have done in there over the past day; perhaps some kind moderator will do you a favour and edit your original … | |
Re: Here are all the errors with your code: 02.cpp:2:16: error: ‘feeSport’ was not declared in this scope 02.cpp:2:27: error: ‘feeOther’ was not declared in this scope 02.cpp: In function ‘int main()’: 02.cpp:9:1: error: ‘cout’ was not declared in this scope 02.cpp:10:9: error: ‘endl’ was not declared in this scope 02.cpp:12:1: … ![]() | |
Re: You do not necessarily have to decrypt a string to use it; it depends what you are using it for. If your string is some kind of password, for example, then you don't need to decrypt it. You can simply encrypt the password the user submits and check that the … | |
| |
Re: [QUOTE=;][/QUOTE] So you've seen with your own eyes what happens in reality, but you're arguing that it shouldn't have happened? | |
Re: Do you know how to make a struct? Where have you actually got to? I'd anticipate you're aiming for something like this: [CODE]while (notFinishedReadingFile) { fileInput >> wineVector[x].name; fileInput >> wineVector[x].score; fileInput >> wineVector[x].year; ++x; }[/CODE] | |
Re: [QUOTE=;][/QUOTE] Did you want it to add the numbers 7 and 4? Try this: int x = 7+4; If you wanted it to do something else, you'll have to tell us what you wanted it to do. If we have to magically guess what you want it to do, we … | |
Re: [QUOTE=;]It works, and I don't know why. The function removeEntry is undeclared int the main() function[/QUOTE] The printf function is also undeclared within the main function too, but you don't seem to be worried about that :) It is not necessary to declare a function inside the main function in … | |
| |
Re: Google says... The problem is that BCC32 is compiling your code for C yet you have included a C++ header file. The STDCOMP.H header file contains preprocessor directives that make sure it is being compiled for C++ and not C. The Borland compiler determines whether to compile for C++ or … | |
Re: Start at the first character. If it is something other than A,B, or C, return 0. Otherwise, go on to next character and repeat. I'll leave it to you to work out how many times you repeat. When you've checked them all, return 1. | |
Re: [QUOTE]I use Dev c++. How can I solve this problem.[/QUOTE] Stop using Dev-C++. conio.h is not standard C++ and there is no guarantee that other compilers come with it, and no guarantee that if they do, the functions work the same way. Dev-C++ uses an old compiler with known problems. … | |
Re: [B]if(0<x<=2000)[/B] This does not do what you think it does. This does not check that x is greater than zero and less than, or equal to, 2000. | |
Re: You can only use [B]break [/B]within a loop, or a [B]switch[/B]. The C++ loops are [B]for[/B], [B]while [/B]and [B]do-while[/B]. You have no loop, so you cannot use [B]break[/B]. | |
Re: Run it from a console (i.e. a command line) and see what error messages you get. | |
Re: Use an image library. DevIL seems to do well. [url]http://openil.sourceforge.net/[/url] | |
Re: The function salarioBruto does not return any value - [B]void salarioBruto(void);[/B] - so you cannot try to make it equal to [B]sBruto[/B]. Instead of [B]sBruto = salarioBruto(void);[/B] write [B]salarioBruto();[/B] This does now give the problem of how to calculate [B]sBruto[/B]. I suggest you rewrite the function [B]salarioBruto[/B] so make it … | |
Re: Assuming that the error is something like: [B]error: ‘th’ was not declared in this scope[/B] the error is that you're trying to use a variable, [B]th[/B], that you never created. | |
Re: A program cannot start itself. You will need another program to start it for you. If you are using a standard operating system such as a *nix or Windows, a program to do that already exists. Under *nix, look up "cron". Under Windows, look up "task scheduler". It will be … | |
Re: Firstly, whatever compiler you're using seems to include <iostream> without you asking it to, and also ignores namespaces. You should get a better compiler. There are many free options. As for why the smallest comes out to -99 every time; it's because the smallest number you enter is -99 (here's … | |
Re: I don't have much to offer, I'm afraid, beyond agreeing that I had a great deal of trouble getting Magick++ to work; not just with Win, but also on Linux. The information about which libraries to actually link was not as easy to find as I might have hoped, and … | |
Re: The namespace you're looking for is called [B]std[/B] The header file you're looking for is called [B]string[/B]. The header file [B]cstring[/B] does not contain the C++ std::string type. This stuff [code=C#]using namespace System; using namespace System::String;[/code] looks like it came from C#. C++ is different. | |
Re: Here's more: [url]http://www.cplusplus.com/forum/articles/36896/[/url] | |
Re: Read in string. Separate each character. Turn each character into number. Is that enough, or do you need more? | |
Re: [url]http://wiki.apache.org/stdcxx/C++0xCompilerSupport[/url] | |
Re: Sounds to me like this "Turbo C++" you keep mentioning does not actually support C++. I suggest you get a compiler that supports C++. | |
Re: When you get that sorted out, don't forget to please stop using Dev-C++ and move to something far, far better. :) | |
Re: A mistake I see repeated over and over and over again; using Dev-C++. | |
Re: [QUOTE]OpenGL is dying. Try directX [/QUOTE] So what exactly are you saying is replacing OpenGL on non-MS operating systems? Please, please, realise that the computing world is larger than your favourite operating system running on your preferred PC. | |
Re: The world of programming is vast. Really, really vast. "Real world" programming is just too vague a term. What do [I]you [/I]think of when you say that? What do you mean? Do you mean GUIs? Embedded code? Operating Systems? Number-crunching algorithms? Code for websites? Databases? There's a lot more, and … | |
Re: There is a great deal to be said for starting with a text editor and calling the compiler/linker manually. It will give you an understanding of what's actually happening that is often lacking in many professional programmers with years of experience. I code mostly on Linux, and I use emacs … | |
Re: [QUOTE]can anybody tell me member functions for this program[/QUOTE] Think of something you do with a library. For example, checking out a book and returning a book. That's two member functions right there. [B]library.checkOut(book); library.return(book);[/B] Now think of more things one can do with a library that you can model … | |
Re: Within main, finish the program with [B]return 0;[/B] [QUOTE]std::string isShutdown; std::cout << "Shutdown? Y/N" << std::endl; std::cin >> isShutdown; if (isShutdown == "Y") { return 0;}[/QUOTE] You can also end a program by using abort() and exit(), but they place additional responsibilities on the conscientious programmer. Using [B]return [/B] is … | |
Re: Try ensuring that you're passing the right kind of variable, by wrapping the string as follows: [B]PlaySound(TEXT("TardisTest1.wav"), NULL, SND_FILENAME | SND_ASYNC);[/B] The project directory is not guaranteed to be the working directory of the executable. Try giving an absolute path (e.g. "C:/TardisTest1.wav"). Also, PlaySound gives a return value. Check that … | |
Re: strlen expects a const char *. You are not passing it a const char *. You are passing it a VARIANT *. You have to pass it a const char *, or something that the compiler knows how to convert into a const char *. | |
Re: No. That's what you've already done. You have to make something else. Right now, your if statement has the following logic: If either of the following two things are true, then triangularPrism: 1) chooseType == "v" 2) "V" Option one there will sometimes be true, sometimes not be true. Option … |
The End.