6,741 Posted Topics

Member Avatar for andy126

That function is kind of scary. What exactly is it supposed to accomplish? I'm reasonably sure I can show you a better way to solve the problem.

Member Avatar for jephthah
0
163
Member Avatar for SanjitVigneshS

>My question is, is F# a really good language, and whether it is useful to learn. It's a decent enough language, and I always advocate learning new languages when you can. F# is useful, to answer your question, but it's not a replacement for C#. >Is it used for software/application …

Member Avatar for dluz
0
206
Member Avatar for llemes4011

[B]>The following document can help you migrate : >[url]http://siddhant3s.googlepages.com/ho...00000000000000[/url][/B] If I may, I'd like to comment on a few parts of that document. [B]>2.3.1 Depreciated Header Files[/B] The word is "deprecated". Depreciate means to lessen in value. Deprecate means to declare a feature obsolescent such that while it's still supported, …

Member Avatar for Narue
0
101
Member Avatar for asifjavaid

[B]>You should perhaps try this: >void* ptr=but_ptr+20;//this is good[/B] Perhaps [i]you[/i] should try it first. You have no excuse for giving an answer that [B]will never compile[/B] on a conforming C compiler. ArkM gave the correct answer (and corrected tux's misconception about casting malloc). Alternatively, you can cast the pointer …

Member Avatar for asifjavaid
0
2K
Member Avatar for Vermillion

[B]>How true can my theory be?[/B] It's about as close to bullshit as an honest theory can be. Knowing a programming language doesn't make one a master programmer. Learning languages is a good thing, but it's only a small part of being a programmer. There are many harder things that …

Member Avatar for Vermillion
0
298
Member Avatar for slawted

[B]>gives me a wierd symbol for the area?[/B] area is declared as a char, and cout is assuming you want to print a character rather than the integral value. Change [ICODE]char area;[/ICODE] to [ICODE]int area;[/ICODE] and you'll get a slightly more reasonable result.

Member Avatar for wildgoose
0
133
Member Avatar for anilopo
Member Avatar for dudebag

[B]>Either way, I don't know how I could trick or trap someone... ?[/B] jephthah was probably thinking about the occasional student who tries to get us to do homework by inviting everyone to participate in a "contest".

Member Avatar for Narue
0
156
Member Avatar for sivak

Do you ever ask questions that aren't [b]easily[/b] found in the manual?

Member Avatar for Narue
0
62
Member Avatar for mathueie

[B]>#include <winbase.h>[/B] Remove that line. It's superfluous anyway as windows.h correctly includes winbase.h.

Member Avatar for mathueie
0
2K
Member Avatar for vmanes
Member Avatar for serkan sendur

[code=csharp] string assemblyPath = Assembly.GetExecutingAssembly().Location; string assemblyDir = Path.GetDirectoryName ( assemblyPath ); string soundsPath = Path.Combine ( assemblyDir, "Sounds" ); [/code]

Member Avatar for serkan sendur
0
455
Member Avatar for fadia

[B]>Even though the break is in it's right place![/B] Just because the compiler points to a line doesn't mean the error is on that line. In your case, you have a rogue [ICODE]do[/ICODE] keyword on line 102. Remove it and the code compiles.

Member Avatar for achied
0
361
Member Avatar for slawted

[B]>hello, first of all welcome[/B] Thanks, it's good to finally be a part of an awesome forum like Daniweb. Wait, something's not right here... [B]>this wont compile[/B] You have a rogue << at the end of your output statement.

Member Avatar for slawted
0
99
Member Avatar for MrNoob

Treat it as a variation of K&R's atoi. You should already know that you can step through the string and add the characters like so: [code=c] result = radix * result + digit; [/code] If radix is 16, you're converting a hexadecimal value. Now all you need to do is …

Member Avatar for Narue
0
573
Member Avatar for animefun2

[B]>For the 20th value, if a 0 was not generated, load >a 0, otherwise get one more random number.[/B] So if 0 was not generated, it'll always be the 20th value? I'd suggest a final step of randomly shuffling the values. That way you get the required 0, but it's …

Member Avatar for seemant_sun
0
196
Member Avatar for DonB

[B]>I'm using Borland's TurboC++ 2006 Explorer. [/B] Then you shouldn't need a makefile, unless you're turning in just the source for your project. IDEs handle that kind of grunt work for you. [B]>The instructor doesn't like using the #include Definitions.cpp in the Driver.cpp file[/B] Wise of him. It's a bad …

Member Avatar for DonB
0
165
Member Avatar for gnobber

@OP: I'm sorry to say it, but so far tux has been unintentionally misleading you. Allow me to clarify. [B]>I've read that the bits in a byte (in c++) are implementation or system dependent.[/B] Yes. [B]>What does that mean?[/B] It means that you can't rely on a byte always having …

Member Avatar for DonB
0
327
Member Avatar for A1 data nz

>The ancient hebrew scripture and large sections of the bible are actually code. Any significant body of text will contain "hidden messages" that mean absolutely nothing and weren't intended by the original author. It's no different from how successful prophecies work: if you're vague enough, they apply to damn near …

Member Avatar for GrimJack
1
151
Member Avatar for MidiMagic

Agree 100%. Perhaps Dani can look into this as she aggressively filters the allowed advertisements on Daniweb. There's no point in making Daniweb's members angry with ads; that defeats the purpose.

Member Avatar for MidiMagic
0
206
Member Avatar for daino

[B]>does the act of initializing that constant data member (providing it >with a value) actually stop you from assigning it the value you >wanted to give it later on in the program?[/B] No, the fact that it's const stops you from assigning to it after initialization. If you don't have …

Member Avatar for dwks
0
165
Member Avatar for ithelp

[B]>Just look at your keyboard and see which key is blurred most[/B] My keyboard is too new to have that kind of wear yet, but on my old keyboard D and J were the blank ones, with Enter, period, and semicolon coming a close second.

Member Avatar for vegaseat
0
164
Member Avatar for mbartos

10 is typically the numeric value of '\n'. Enter is a character too, so when you type a character and then press Enter, that puts two characters on the stream. See if you can find the problem with that explanation of your output.

Member Avatar for ArkM
0
322
Member Avatar for lanaee

It's pseudocode. It doesn't need to be perfect, it just needs to express your logic accurately. Oh, and do your own damn homework.

Member Avatar for Narue
0
42
Member Avatar for Fasola

>What is the MOST important thing to do when developing new code or modifying existing code Understand the problem to be solved, of course. This takes precedence over everything, including correct functionality. >Why? If you don't understand the problem, you can't possibly develop a new program or modify an existing …

Member Avatar for Fest3er
0
733
Member Avatar for catchmrbharath

>By the way this is a C++ forum and not a C forum. Yes, yes it is. But printf and scanf are a part of C++ as well. It's not uncommon to drop down to stdio when iostreams are too slow. >We usually don't understand printf and scanf. Speak for …

Member Avatar for s_sridhar
0
152
Member Avatar for JackDurden

The same way, except instead of dealing with only two links, you have more than two (usually in an array).

Member Avatar for csurfer
0
123
Member Avatar for Thediabloman

iter is invalid after calling erase, so you can't legally increment it. You need to be more careful about how you obtain the next iterator: [code=cplusplus] for (iter = gameList.begin(); iter != gameList.end(); ) { if (*iter == deleteGame) iter = gameList.erase(iter); else ++iter; } [/code]

Member Avatar for Narue
0
86
Member Avatar for swisschris104

[B]>Lemme Tell you All About Me Before Yu All Pile On Me! Im Only 14! [/B] You're old enough to understand the basics of proper spelling, grammar, and sentence structure. [B]>Can Someone Exsplain Boolean (bool)[/B] The bool type is very simple. There are two states: true and false. Let's say …

Member Avatar for Narue
0
134
Member Avatar for Benkyou

>when i tried aux=aux->prox ...aux becomes invalid because aux->prox is an uninitialized pointer. Any further use of aux, except to point it to another address, is doomed to failure.

Member Avatar for Benkyou
0
114
Member Avatar for Poab9200

[B]>You also need to master the basics elements >such as generics, delegates, interfaces, etc. [/B] I'm a fan of generics, but I don't delude myself into thinking that they're required knowledge. You can get by without writing a single generic class or method and still be an non-novice. Laundry lists …

Member Avatar for Poab9200
0
124
Member Avatar for serkan sendur

[B]>>Foreach works on the string array, not on the function call. >yeah that is what i concluded and surprised.[/B] Right. No offense, but that's pretty obvious when you consider that the expression for foreach requires some form of enumerable collection. foreach is really just syntactic sugar that's converted to a …

Member Avatar for serkan sendur
0
117
Member Avatar for luvnbigd1111

>I have to interview one-and my options are running out. Why don't you search the forum for similar interviews? Your questions are hardly unique. I know for a fact that I've thoroughly answered each of them for students looking to interview a programmer.

Member Avatar for aditya2071990
0
143
Member Avatar for CppFTW
Member Avatar for Peyton

The fact that it's printing more than twenty numbers should be a strong indication that your condition for the loop in displayArray is incorrect. Specifically, it's written with a C-style string in mind, not an array of float. Try passing the size to displayArray like you do with setArray. That …

Member Avatar for Peyton
0
105
Member Avatar for jeremyg

[B]>Can you explain what is it: [I]binary search tree sorted with quicksort method[/I]???[/B] It's a poorly worded question. Clearly a binary search tree is already sorted by nature, so quicksorting the tree itself is nonsensical. By the looks of the code, the OP wants to copy the contents of the …

Member Avatar for jephthah
0
168
Member Avatar for seemant_sun

Perhaps if you explained exactly what you were expecting and how what you got is different...

Member Avatar for William Hemsworth
0
382
Member Avatar for Kiba Ookami

>I use the Turbo C++ 3.0(dont judge it by graphics) as its easier to use. Then your outdated suggestions are likely to be useless to the majority of people here. C++ has grown since then, and most modern compilers will simply refuse to compile your code.

Member Avatar for Stefano Mtangoo
0
242
Member Avatar for Unhackmee

Simplest solution: store the result values in an array, then traverse the array backward.

Member Avatar for William Hemsworth
0
97
Member Avatar for phoenix911

>shu shu shu shut you mouth You can dish it out, but you can't take it? That's pretty sad.

Member Avatar for jephthah
0
196
Member Avatar for kostasxx

You've got a massive memory leak. Each time the loop iterates, you replace your pointer with a new block of memory. I imagine you wanted realloc instead of malloc: [code=c] #include <stdio.h> #include <stdlib.h> #define CHUNKSIZE 5 int main ( void ) { unsigned long *array = 0; size_t capacity …

Member Avatar for Narue
-1
2K
Member Avatar for monkey_king

>Before anyone starts talking about mixing c++ and c, >I know it's generally a bad idea but std::strings are to slow. It's not generally a bad idea, but I'm curious why you think std::strings are too slow. Have you written your code using them, profiled it, and determined that the …

Member Avatar for ArkM
0
2K
Member Avatar for Jupiter 2

>I accidently posted a thread meant for this forum >and got a tirade of abuse from "you know who". Please link to the thread you're referring to. Looking at your account, I see you've only started five threads, none of which contain any form of abuse. You've never received a …

Member Avatar for Narue
0
201
Member Avatar for chri5ty

>because developers (who are not necesarily programmers) believe >that the hardware is so powerful that it will carry out any task This is an unfair generalization. Just like any field, software development has great variance in the quality of developers. There are a handful of gurus, a half-decent amount of …

Member Avatar for Jupiter 2
0
247
Member Avatar for Jupiter 2

We can't create a forum for every language, but [URL="http://www.daniweb.com/forums/forum42.html"]this one[/URL] is a catch-all for the languages that aren't explicitly mentioned. VBA is sufficiently different from VB 4/5/6 to go there, but other VB questions are probably better suited to the VB 4/5/6 forum or VB.NET.

Member Avatar for Dani
0
162
Member Avatar for Jupiter 2

No forum is exempt from moderation. Perhaps you should read and follow the rules instead of whining about it.

Member Avatar for Ancient Dragon
0
240
Member Avatar for monkey_king

1) Functionally, in that situation, the two are the same. What you're seeing in the first example is C's comma operator in action. Occasionally you'll see people use it to avoid braces. Whether that's a good idea is debatable. 2) [URL="http://www.cplusplus.com/reference/clibrary/cstdlib/div_t/"]div_t[/URL] is a standard structure. Do you have a more …

Member Avatar for monkey_king
0
217
Member Avatar for lyardson

DarthPJB, it's a good idea to [I]not[/I] take iamthwee seriously, in pretty much every case from what I've seen.

Member Avatar for mirfan00
0
280
Member Avatar for ithelp

1) Define a "thing" 2) Define "emit" 3) Define "vibration" Prove: * Show that all known things emit vibration. Disprove: * Display one case of a thing that does not emit vibration.

Member Avatar for GrimJack
0
310
Member Avatar for Clockowl

The state of the stream and the contents of the buffer are separate. Even though you reset the buffer to a new string, the stream is still in an end-of-file state from the previous read. You'll notice that out_offset is correctly set to 3 because the stream starts off in …

Member Avatar for Clockowl
0
167

The End.