5,237 Posted Topics

Member Avatar for bobcats

> thanks for the things about frequency tables but we arent allowed to use them. Which is why it is pointless to ask people to do your homework. Not only would we have to vaguely guess at what you really wanted, we also have to guess at how much to …

Member Avatar for bobcats
0
353
Member Avatar for pupsia

Pretty close with the last effort, but you still need to work on whether you're programming in C or C++. [code] #include <stdio.h> #include <math.h> int main() { /*!! missing */ char buff[BUFSIZ]; int i, a, b, c, x, n; printf("Enter the value for n:"); /*!! not scanf */ /*!! …

Member Avatar for John A
0
385
Member Avatar for jnabeel
Member Avatar for jnabeel
0
132
Member Avatar for rajeshreddy

[url]http://www.daniweb.com/techtalkforums/announcement8-2.html[/url]

Member Avatar for Salem
0
68
Member Avatar for boujibabe

> for (int i=0;i<row_size;i++) This is C, not C++ You must declare int i; at the start of the block, and then for (i=0;i<row_size;i++) > attempts++; Since the preceding if and else both contain continue, how is this line ever executed? Using a few more braces would help as well.

Member Avatar for Lazaro Claiborn
0
275
Member Avatar for fulyaoner

Seems to me like it's a variation of the knapsack problem. [url]http://en.wikipedia.org/wiki/Knapsack_problem[/url] One way would be - all permutations of 1 coin - all permutations of 2 coins - all permutations of 3 coins etc For each permutation, add them up and see if they match the total you want.

Member Avatar for fulyaoner
0
407
Member Avatar for stringgader

> im a frend of stringgader,, So create your own account (it's not hard) so we know who we are talking to. > this is my problem: And [URL="http://www.daniweb.com/techtalkforums/announcement8-2.html"]this[/URL] is the standard answer to effort-free posts such as yours.

Member Avatar for Salem
0
118
Member Avatar for Duki

> for ( age = (START_AGE + 1); age <= STOP_AGE ; age++ ) //age + 1: counter starts at 0 > newPrin = newPrin + (newPrin * INT_RATE) ; If you want the rest of the code to be part of the for loop, then you need to use …

Member Avatar for Salem
0
178
Member Avatar for jnabeel

Here is the new thread - [url]http://www.daniweb.com/techtalkforums/thread71992.html[/url] Suggest closing this before it attracts flies.

Member Avatar for Salem
0
83
Member Avatar for ctrohana

> main() You may as well get used to saying [URL="http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1044841143&id=1043284376"]int main[/URL] Implicit declarations for anything are deprecated, meaning they simply won't work at some future date. > while (!feof(dataptr)) Read [URL="http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1046476070&id=1043284351"]this[/URL] [INLINECODE]while ( fgets( data, sizeof data, dataptr ) != NULL )[/INLINECODE] Is a good way of safely reading …

Member Avatar for Salem
0
133
Member Avatar for Salem

It's even smaller than an 80x25 terminal now! Just a mere postage stamp stuck in the bottom-left corner of the page, with acres of white space all around it.

Member Avatar for happygeek
0
147
Member Avatar for Lord Vespa

> i need some examples of combat systems. Read up on "[URL="http://en.wikipedia.org/wiki/Rogue_(computer_game)"]rogue[/URL]", the classic text mode game. You have weapons, which cause variable amounts of damage - knife, 1 to 5 - broad sword, 20 to 50 You have armour, which resists damage - leather, 1 to 5 - plate, …

Member Avatar for Lazaro Claiborn
0
174
Member Avatar for chubbywubba

> says where "case 81" is that i already used it but I have not. 'Q' is 81 in ASCII, so yes, you used it twice. So if all your other magic numbers are really letters, then use letters.

Member Avatar for thekashyap
0
129
Member Avatar for mapaputsi

Doesn't anybody know how to search the web anymore? [url]http://en.wikipedia.org/wiki/Big_O_notation[/url]

Member Avatar for ~s.o.s~
0
161
Member Avatar for spacecowboy123

> Does the U in at the end of 1234U signify that it is unsigned? Yes. > The kind of number it is a uint64_t. Does this mean it is an usigned integer 64 bit? Probably, though perverse people could equally write [INLINECODE]typedef double uint64_t;[/INLINECODE] and the compiler might not …

Member Avatar for Salem
0
98
Member Avatar for donaldunca

A few instant problems 1. Over reliance on global variables. 2. Your print routine starts at 'p', not first. Your p variable is the last node created. 3. scanf("%s",&tl); t1 doesn't point at any memory. At a push, the minimum would be these snippets [INLINECODE]char t1[10]; scanf("%s",t1); while( t1[0] != …

Member Avatar for mathematician
0
290
Member Avatar for youngone

I dunno, maybe actually try it for yourself rather than wandering from [URL="http://cboard.cprogramming.com/showthread.php?t=89006&highlight=days"]board to board[/URL] in the hope that someone will spoon-feed you the answer.

Member Avatar for WaltP
1
128
Member Avatar for Clinton Portis

[url]http://en.wikipedia.org/wiki/Floating_point[/url] The number of bits you dedicate to the exponent determine the range of floating point numbers you can support. The number of bits in the significand (I don't know what sigment could mean otherwise) determines the accuracy of any individual floating point number. The bias is an offset applied …

Member Avatar for Salem
1
132
Member Avatar for RobertNashon

Read this, then edit your post so we can read it. [url]http://www.daniweb.com/techtalkforums/announcement8-3.html[/url] Actually say what the problems are, this isn't a service where you can just dump your code and expect people to magically figure out what you want. In future, press "compile" every 10 lines or so to make …

Member Avatar for dwks
0
195
Member Avatar for MiloTN

> #define FUNC(x) ((*func)(x)) Why? [INLINECODE]func(x)[/INLINECODE] works just as well, even when it is a function pointer. > gets(filename); No points for using [URL="http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1049157810&id=1043284351"]gets()[/URL] > buffer = (float*) malloc (sizeof(float)*lSize); There is no need to cast malloc in C either, if you've done things properly. [url]http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1047673478&id=1043284351[/url] At best, it does …

Member Avatar for dwks
0
132
Member Avatar for RisTar

> how can i draw a box using graphics library , and what library should i use Well you need to start by saying which OS and compiler you're using. Though I'm going to guess it's Turbo C and XP or some other hopelessly mis-matched combination.

Member Avatar for Narue
-1
2K
Member Avatar for ajay kandari

And don't forget the code tags when posting code. http://www.daniweb.com/techtalkforums/announcement8-3.html

Member Avatar for Ancient Dragon
0
92
Member Avatar for virsa

> Wouldn't you use a public member function to access and modify private member variables? Yes everyone else would. But some people seem to like asking stupid questions like this which subvert the whole idea of using an OO language for data encapsulation. Like somehow knowing that if you could …

Member Avatar for Laiq Ahmed
0
140
Member Avatar for ammochck21

> if (a(left) == b(left)) When did ( ) become the array subscript operator?

Member Avatar for John A
0
120
Member Avatar for tlly

> And why respond to a year-old thread? Because they can :rolleyes: > if(!*check[through]=={'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0'}) Gotta wonder what the hell that's supposed to achieve.

Member Avatar for Salem
0
128
Member Avatar for ajay kandari

Maybe they're compiling it with some 16-bit fossil compiler, then wondering why the program produces weird results past say 7! or 8!

Member Avatar for Salem
0
402
Member Avatar for Joe689

> I need to come up with a new method of region growing with better memory managment. Maybe lists? It would have to be a pretty sparse array to make this work well. You can't index a list the same way you can an array, so any more than a …

Member Avatar for Salem
0
274
Member Avatar for hellokitkat

> usingnamespace std; Whatever crappy code colouring tool you're using, stop using it and use the board code tags. Few people are going to be bothered to trawl through unindented code which isn't even compilable, and has been corrupted in transmission. [url]http://www.daniweb.com/techtalkforums/announcement8-3.html[/url] > help with encryption! asap Your urgency isn't …

Member Avatar for Salem
0
151
Member Avatar for amirwan

[url]http://www.daniweb.com/techtalkforums/post306665.html#post306665[/url] Lemme guess, you're real OS is actually Win2K, but you're clinging to some crappy old 16 bit compiler and pretending that you're using DOS. I guess the DOS emulation on your machine isn't up to supporting that particular network hackery code (yes, networking in 16-bit real mode was always …

Member Avatar for Salem
0
103
Member Avatar for JaksLax

> because to me it looks like you pass the sum and cBit into the function Well one is a pointer, and the other is a reference. So they could both be used for input, input/output or output. The other two parameters are declared const, so that just makes them …

Member Avatar for JaksLax
0
237
Member Avatar for boujibabe

> "term does not evaluate to a function taking two arguments" You have an int parameter called rand, which is hiding the function rand() by scope.

Member Avatar for WaltP
0
132
Member Avatar for niceliang84

[url]http://www.catb.org/~esr/faqs/smart-questions.html#urgent[/url] I'll go with your LUC array isn't big enough, or you don't set x to 0 before you start, or you don't reset x to 0 when you read the second file.

Member Avatar for Ancient Dragon
0
148
Member Avatar for live_atl

[URL="http://www.catb.org/~esr/faqs/smart-questions.html#prune"]A pot of gold at the end of the rainbow[/URL] > i try to write this problem in c++ but didn't work can somebody please help me with this Well post it, then we can really start to help you rather than do the work for you (which isn't going …

Member Avatar for Lazaro Claiborn
0
119
Member Avatar for iaaan

Since structure assignment is supported, just do [code] temp = Quote[j+1]; Quote[j+1] = Quote[j]; Quote[j] = temp; [/code] where temp is the same type as the struct used for your array.

Member Avatar for iaaan
0
172
Member Avatar for jobra

Even better if you're on Unix/Linux/Cygwin [code] $ split --help Usage: split [OPTION] [INPUT [PREFIX]] Output fixed-size pieces of INPUT to PREFIXaa, PREFIXab, ...; default size is 1000 lines, and default PREFIX is `x'. With no INPUT, or when INPUT is -, read standard input. Mandatory arguments to long options …

Member Avatar for Salem
0
105
Member Avatar for n.aggel

> but i was wondering if there is a faster way to do this Why do you need it to be faster? Seems like a case of [URL="http://www.petefreitag.com/item/509.cfm"]POD[/URL] If you need to do it a lot, then construct (with mktime) two time_t's which are 5am and 6am. Then do difftime() …

Member Avatar for Ancient Dragon
0
153
Member Avatar for degamer106

1. If your destructors are always calling delete, then every single constructor you have MUST initialise the pointers to at least 0. 2. Your copystate function just makes copies of the pointers (you now have two pointers pointing at the same memory). Bad things happen when you try and delete …

Member Avatar for Salem
0
130
Member Avatar for evilsilver

> Have you considered simplifying your code by using a couple of structs? Have you considered the possibility that this thread is 2 YEARS old, and that the OP has probably moved on.

Member Avatar for Salem
0
106
Member Avatar for iaaan

The string returned by getline probably has a newline on the end of it (which won't be in any string you're comparing against). Or it's the classic mixing "cin >> var" with getline, and getline just returns with the newline which cin left behind.

Member Avatar for iaaan
0
96
Member Avatar for lai_flipper

This should be in a bigger font, because people keep missing it. [B][url]http://www.daniweb.com/techtalkforums/announcement8-2.html[/url] [/B] Work on your question titles as well [url]http://www.catb.org/~esr/faqs/smart-questions.html#bespecific[/url]

Member Avatar for jwenting
0
46
Member Avatar for Xzantose

[url]http://www.mono-project.com/FAQ:_General#What_does_the_name_.22Mono.22_mean.3F[/url]

Member Avatar for blacklight
0
145
Member Avatar for monishamahna
Member Avatar for Salem
0
63
Member Avatar for rwagnes

Except simply seeking to the end doesn't take into account any translations which may occur when the file is read byte by byte (even if you do read them all in one call). [url]http://c-faq.com/osdep/filesize.html[/url]

Member Avatar for rwagnes
0
340
Member Avatar for ahmadocx

[LIST=1] [*]Read the manual [*]Try some examples [*]Adapt to your own requirements. [/LIST] Or maybe it's one of those new controls which is only in .net, in which case you're sunk. You're not giving us much to work with, with that terse post.

Member Avatar for Salem
0
37
Member Avatar for smallpau1

> And our instructors havent told us about the int main() yet I doubt they even know (or care). One wonders what other rubbish they're going to teach you based on their broken understanding of the language. > so i dont want to get in trouble by using it Or …

Member Avatar for Salem
0
122
Member Avatar for CurtisBridges
Member Avatar for hariza

> while (!feof(fp)) { > fgets(line,LINE_BUF,fp) Don't use feof() in a control loop [url]http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1046476070&id=1043284351[/url] Do something like [INLINECODE]while ( fgets(line,LINE_BUF,fp) != NULL )[/INLINECODE] Perhaps he means remove the newline which fgets returns. Which would be [code] while ( fgets(line,LINE_BUF,fp) != NULL ) { char *p = strchr( line, '\n' ); …

Member Avatar for hariza
0
5K
Member Avatar for amishosh

> Is VB the only way the program will open up in a windows like window? You have a choice - create a console application, or create a windows application (or several other types as well). Console (what you call DOS, but it isn't) begin with main() Windows GUI programs …

Member Avatar for fesago90
0
123
Member Avatar for Firestone

> it starts producing negative numbers Yeah, somewhere between 40 and 50 IIRC, the size of F(n) becomes larger than what can be stored in a 32-bit integer and that's what you're seeing. One fix is to use a bignum package like [URL="http://www.swox.com/gmp/"]GMP[/URL]

Member Avatar for Salem
0
134
Member Avatar for RossSCann

> apen = CreatePen(PS_SOLID, 1, colorG[7]); So delete/release/free/whatever the pen as well.

Member Avatar for Salem
0
90

The End.