1,288 Posted Topics

Member Avatar for cheeseboy
Member Avatar for meli123

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.

Member Avatar for doug65536
-1
272
Member Avatar for Superandomness

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 …

Member Avatar for Superandomness
0
229
Member Avatar for Rupindersingh

[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.

Member Avatar for Narue
0
246
Member Avatar for kylelendo

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 …

Member Avatar for scrappy57
0
160
Member Avatar for nzdude09

[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.

Member Avatar for Moschops
0
250
Member Avatar for asrockw7

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 …

Member Avatar for Moschops
0
163
Member Avatar for glut

[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 …

Member Avatar for sfuo
0
212
Member Avatar for valestrom

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 …

Member Avatar for valestrom
0
479
Member Avatar for tyu1996

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 …

Member Avatar for cse.avinash
0
194
Member Avatar for valestrom

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.

Member Avatar for valestrom
0
205
Member Avatar for akhilchandranms

Exactly. The digit "8" does not exist in octal. The digits "1", "2", "3" and "4" do exist in octal.

Member Avatar for cse.avinash
0
101
Member Avatar for lynn21

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 …

Member Avatar for lynn21
0
116
Member Avatar for cent91

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 …

Member Avatar for Moschops
0
2K
Member Avatar for Vusumuzi

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: …

Member Avatar for Mouche
0
342
Member Avatar for lochnessmonster

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 …

Member Avatar for TrustyTony
0
146
Member Avatar for pravin_bug
Member Avatar for pravin_bug
0
71
Member Avatar for a.muqeet khan
Member Avatar for theguitarist

[QUOTE=;][/QUOTE] So you've seen with your own eyes what happens in reality, but you're arguing that it shouldn't have happened?

Member Avatar for theguitarist
0
143
Member Avatar for HelpStudents

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]

Member Avatar for raptr_dflo
0
206
Member Avatar for natha_peepli

[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 …

Member Avatar for asitmahato
0
104
Member Avatar for DJWK

[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 …

Member Avatar for Adak
0
147
Member Avatar for zxcvbnm,.
Member Avatar for zxcvbnm,.
0
100
Member Avatar for ron_e

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 …

Member Avatar for Ancient Dragon
0
634
Member Avatar for programg

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.

Member Avatar for Cross213
0
93
Member Avatar for Anuradha Mandal

[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. …

Member Avatar for himgar
0
112
Member Avatar for Anuradha Mandal

[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.

Member Avatar for Narue
0
122
Member Avatar for Anuradha Mandal

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].

Member Avatar for Anuradha Mandal
0
103
Member Avatar for wackytechie
Member Avatar for NIPHZ
0
4K
Member Avatar for shizu

Use an image library. DevIL seems to do well. [url]http://openil.sourceforge.net/[/url]

Member Avatar for mrnutty
0
3K
Member Avatar for rayden150

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 …

Member Avatar for Moschops
0
963
Member Avatar for radiata

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.

Member Avatar for WaltP
0
178
Member Avatar for san-angelo

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 …

Member Avatar for Caligulaminus
0
114
Member Avatar for clickspiker23

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 …

Member Avatar for NathanOliver
0
173
Member Avatar for pseudorandom21

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 …

Member Avatar for Celtrix
0
256
Member Avatar for apanimesh061

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.

Member Avatar for teo236
0
1K
Member Avatar for WaltP
Member Avatar for pseudorandom21
0
1K
Member Avatar for kuntakkhong

Read in string. Separate each character. Turn each character into number. Is that enough, or do you need more?

Member Avatar for Moschops
-1
45
Member Avatar for NathanOliver
Member Avatar for NathanOliver
0
367
Member Avatar for gujinni

Sounds to me like this "Turbo C++" you keep mentioning does not actually support C++. I suggest you get a compiler that supports C++.

Member Avatar for gujinni
0
376
Member Avatar for jared crook

When you get that sorted out, don't forget to please stop using Dev-C++ and move to something far, far better. :)

Member Avatar for Moschops
0
168
Member Avatar for mrnutty

A mistake I see repeated over and over and over again; using Dev-C++.

Member Avatar for Moschops
0
144
Member Avatar for Labdabeta

[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.

Member Avatar for dvidunis
0
249
Member Avatar for massivefermion

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 …

Member Avatar for Ancient Dragon
0
440
Member Avatar for Thisisnotanid

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 …

Member Avatar for Moschops
0
238
Member Avatar for adityasingh

[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 …

Member Avatar for Moschops
0
111
Member Avatar for emmaand

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 …

Member Avatar for murnesty
0
8K
Member Avatar for thecoolman5

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 …

Member Avatar for m4ster_r0shi
0
3K
Member Avatar for steve421

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 *.

Member Avatar for Ancient Dragon
0
865
Member Avatar for FriXionX

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 …

Member Avatar for FriXionX
0
118

The End.