6,741 Posted Topics

Member Avatar for Jennifer84
Member Avatar for monkey_king

>I know it's good programming practice to make >accessor's const. But does it impact speed. It can, but usually nowhere close to as much as many people believe. const is more for your benefit because it helps make your code easier to work with by adding compile-time invariants. >Will I …

Member Avatar for Narue
0
151
Member Avatar for zabr

>that is the code for decimal to binary... That's pretty awful. At least it kind of works. >#include <conio.h> You don't even use anything from this header, why destroy portability by including it? >void main() Here is the only correct definition of main with no parameters: [code=c] int main ( …

Member Avatar for Aia
0
127
Member Avatar for bleh1318

>The first one is I'm wondering what is the best library to use for a hash table in a C++ It depends on what you need. Google's sparse hash library is nice, and if you can find a good implementation of TR1 (such as Dinkumware), you can use the hash_set …

Member Avatar for Narue
0
120
Member Avatar for fromthatside

>so my qusetion is that :I need to know how many >the libraries under C language until this day.. ? It sounds like you just want to focus on Win32 for now. You can start [url=http://winprog.org/tutorial/]here[/url], but eventually you'll be checking [URL="http://msdn.microsoft.com/en-us/library/aa139672.aspx"]MSDN[/URL] regularly. Note that GUI programming is not easy …

Member Avatar for ArkM
0
172
Member Avatar for errorman

That's a classic error. It means you created a Win32 application project but wrote code for a console mode application. The former requires WinMain instead of main as the entery point.

Member Avatar for Narue
0
164
Member Avatar for mabuse

>Do you think that an old compilator can differ a magnitude order from the new one? Yes. Especially since Visual C++ 6.0's STL implementation was extremely weak. >Can I do easily a dll for windows without using Microsoft Visual C++ compilator? Writing DLLs in Windows is not difficult. Though I …

Member Avatar for mabuse
0
475
Member Avatar for Achmat

[QUOTE=jephthah;671431]i thought this thread was about "strangling newbies" imagine my dismay when i found a ten-mile long post full of incoherent code with no syntax coloring.[/QUOTE] That was completely uncalled for, jephthah. If you're going to take the path of the angry programmer, at least try to follow the lead …

Member Avatar for jephthah
0
281
Member Avatar for Acidburn

The condition must evaluate to a boolean type. Unless result[i][1] is already a boolean type, you can't use it without a relational test: [code=csharp] String str = ( (String)result[i][1] != null ? (String)result[i][1] : "" ); [/code] Also, what type is result[i][1] such that a cast to String is required?

Member Avatar for Narue
0
107
Member Avatar for Gentile
Member Avatar for SaShenka

Viewing the "machine code" is pretty much a silly idea. More likely you want to see the assembly code that corresponds to the machine code. In that case there are two easy ways depending on whether you have the C++ code available or not. If you have the source code, …

Member Avatar for Narue
0
66
Member Avatar for vijaysoft1

>#include<conio.h> I recommend you forget this header exists until you learn why it's a bad idea. >void main() main returns int. >char *typed; >gets(typed); That's just brilliant. Not only did you fail to allocate memory to typed (who knows where those characters are being written), you chose to use gets …

Member Avatar for Narue
0
122
Member Avatar for SiRuS

>Hello guys this is my code. It's not often that looking at code can leave me speechless. >Can anyone help me please??? Sure. Let's start by looking at the fatal errors: >char str[] = { 0 }; As much as many C programmers would love for this to declare a …

Member Avatar for Ancient Dragon
0
166
Member Avatar for minnie

>I'm a CS student and as far as my experience tells me I'm thinking you need some more experience if you can't tell that 2004 was two years ago.

Member Avatar for Salem
0
167
Member Avatar for Salem

As I understand the issue, Dani isn't against an automated solution as long as it's generalized. Every time we bring up the issue, she asks us for a good way to handle checking for code tags with every language that Daniweb has a forum for. A good suggestion has yet …

Member Avatar for jasimp
1
190
Member Avatar for kneiel

>I ended up having to do some research on why the cast the >OP mentioned was legal, and I admit I still do not understand. Put simply, the cast is an "I know what I'm doing" switch that turns off the safety net. In this case, and on the OP's …

Member Avatar for Alex Edwards
0
174
Member Avatar for Asem1

>I run the code on a linux machine and gave me errors.. What errors? Posting your code and your assignment isn't conducive to getting help because it suggests that you want us to finish your project for you, which isn't going to happen.

Member Avatar for Narue
0
98
Member Avatar for aftommy
Member Avatar for xyzt

>whether it's attributable the to size of the class or not I don't know Only actual data (explicit data members, hidden data members, and padding) adds to the size of an object in memory. Member functions are stored elsewhere, and not duplicated for each object.

Member Avatar for Narue
0
825
Member Avatar for harshchandra
Member Avatar for Nick Evan
0
427
Member Avatar for Sukhbir

>At least that's how my reference explains it. You might be misunderstanding your reference. There's an implicit conversion operator and a function call operator The function call operator is a general member function in terms of return value and parameters. The implicit conversion operator takes no parameters ([ICODE]*this[/ICODE] is implied) …

Member Avatar for Narue
0
126
Member Avatar for jobs

[QUOTE=elite1986;497723]I do not meet that command . You can use for small files < 3.2MB; char *t; FILE *fp; fgets( t, 32767, fp);[/QUOTE] How did you come up with 32767? If your files are smaller than 3.2MB, you still have to account for up to 3.2MB, which is 3355443, not …

Member Avatar for Narue
0
265
Member Avatar for ViRiPuFF

>I get no errors but nothing happens when I click the button. I'm guessing that something does happen, but since you don't do anything that produces a noticeable effect, it seems like nothing is happening.

Member Avatar for bruce2424
1
497
Member Avatar for TKSS

The only standard method is the system function: [code] #include <cstdlib> #include <iostream> int main ( int argc, char *argv[] ) { if ( argc < 2 ) { std::cerr<<"Too few arguments"<<std::endl; return EXIT_FAILURE; } // Be ultra-anal if ( std::system ( 0 ) == 0 ) { std::cerr<<"No command …

Member Avatar for Salem
0
234
Member Avatar for Labombadog

>My favorite games are Zelda: OOT, Chrono Trigger/Cross, Xenogears, al Final Fantasies, and Earthbound. I like you already. :) Might I also suggest Xenosaga, Lunar, Lunar 2, Wild Arms, Tales of Destiny, and Tales of Symphonia? >I compile it and it says that there is an error. The code is …

Member Avatar for mahlerfive
0
132
Member Avatar for keithmolo

>i just can't imagine it being really THAT hard of a feature to implement. It's not. In fact, I believe it's a feature of vBulletin if you choose to enable it. >i really wish threads that have been inactive for >more than 90 days would be automatically locked. I don't. …

Member Avatar for jephthah
0
192
Member Avatar for Ancient Dragon

>what programmers use it for in real-world programs such as system, applications, etc. Recursive descent parsing comes to mind. >Parse binary trees Actually, my experience is that nearly every recursive algorithm when working with binary trees is better written iteratively. This improves the performance[1], footprint guarantees[2], reliability[3], and flexibility[4]. [1] …

Member Avatar for sciwizeh
0
817
Member Avatar for Dani

>I'd like to know what pisses you off about DaniWeb? The fact that each page is noticeably slow to load (between 1 and 4 seconds for threads and just enough to throw me off on the main forum list), even with ads disabled. This wouldn't be nearly as frustrating if …

Member Avatar for William Hemsworth
0
997
Member Avatar for MaestroRage

>Then use sscanf() to read that string into an int previously declared. If you're already validating the string, sscanf is overkill. If it's a valid integer you can use atoi safely. Or better yet, you can combine the conversion and the validation with strtol: [code=c] #include <errno.h> #include <stdio.h> #include …

Member Avatar for jephthah
0
213
Member Avatar for sara.rythm

When all pertinent information has been discussed, and it appears that future posts will only cause trouble.

Member Avatar for The Dude
0
186
Member Avatar for Daco

unsigned char and char are different types. ncb_callname should probably be of type char (I assume it's an array) rather than unsigned char.

Member Avatar for sachin1_pangare
0
527
Member Avatar for Natso

>I have little chance of actually getting anywhere in the game development >industry - because I am not getting a degree that is specifically game related. I'd say your friend is full of it. Ability trumps education every time, and the gaming industry is especially well-known for turning basement coders …

Member Avatar for ripsocrates
0
118
Member Avatar for Dave Sinkula

Or offer the option to turn that feature off in one's control panel. I personally would use it because I always preview before posting anyway.

Member Avatar for WaltP
0
123
Member Avatar for vegaseat

>I keep hearing that Python is about as slow as Java. Java can be comparable in speed to C++ or as slow as Christmas. It's not a good measure. >Does anybody have experience with speeding things up? Are you having problems with performance? If not, why bother? In my experience …

Member Avatar for Gribouillis
0
491
Member Avatar for invisal

Wow, that guy looks like a lot of fun. What IRC server/channel was that in? :) But yes, hacking can mean writing. There are multiple definitions of "hacking", and one of those is skillfully writing programs (or kludges, depending on the context).

Member Avatar for Ancient Dragon
0
388
Member Avatar for kneel

I disagree, of course. Quality is paramount even when doing incremental releases. The increments refer to feature sets, not bug fixes.

Member Avatar for chaosprime
0
152
Member Avatar for jkrege03

It's a good think you posted your code before it passed 1000 lines, otherwise we might complain that it was too long...

Member Avatar for ssaurabh
0
1K
Member Avatar for Tigran

>But where I worry about it the age of the book No worries, the contents are still relevant.

Member Avatar for Frederick2
0
126
Member Avatar for plike922

>You're getting C++ errors. C++ is a lot stricter. Try using a C compiler. So your advice is to ignore the warning and let the problem silently continue. Brilliant. :icon_rolleyes: >"cannot convert from" is a C++ (and in general, OOP) only error afaik. You get it in C as well …

Member Avatar for dmf1978
0
179
Member Avatar for dashisneo

Break the problem down into manageable pieces, then solve each one individually. That should minimize the smothering effect of a complicated problem and you'll end up with specific questions that we can answer and specific problems that we can help with. Asking for "help right from the scratch" suggests that …

Member Avatar for VernonDozier
0
120
Member Avatar for Alex Edwards

>I do not know if my code will be portable when I start learning it. It won't be. Assembly languages are only portable to the processor family (and depending on the features you use, the family subset) they're implemented for. >Do other Assembly languages conform to the same standards The …

Member Avatar for Narue
0
140
Member Avatar for anirudhbsg
Member Avatar for plike922

That usually happens to me when I forget to close the output window for a debug run.

Member Avatar for plike922
0
117
Member Avatar for shAq

>but it gives a floating point format not linked error. Wow, I haven't seen that error in a [b]long[/b] time. It used to be a [url=http://www.eskimo.com/~scs/C-faq/q14.13.html]frequently asked question[/url], maybe you should get a newer compiler. >How do i convert the coordinate values to those that could be outputted by the …

Member Avatar for saud3001
0
364
Member Avatar for kneel

>1. Pointers increase the efficiency of our programs They also decrease the efficiency of programs. >2. Pointers degrade reliability of C++ programs due to security issues Only if used improperly, just like any other language feature.

Member Avatar for oliver_mk
0
66
Member Avatar for peter_budo

Seen it, many times over, on several versions of Windows. That joke is officially old and tired, but I expect we'll see it on every version of Windows in the future as well.

Member Avatar for dmf1978
3
183
Member Avatar for kux

>in the second implementation the MyException object >is allocated on heap, but how about the first one? It's unspecified: [quote=C++0x Draft] 3 A throw-expression initializes a temporary object, called the exception object, the type of which is determined by removing any top-level cv-qualifiers from the static type of the operand …

Member Avatar for ArkM
0
109
Member Avatar for franziss

It means you probably wrote to memory you don't own, perhaps by overrunning a buffer, freeing memory more than once, or forgetting to initialize a pointer before using it.

Member Avatar for franziss
0
1K
Member Avatar for RandV80

>But what I can't seem to access is the constructor. This is where the C memory functions fall flat, they don't work well with constructors and destructors. I recommend ditching calloc and using new[]: [code=cplusplus] CObject *group = new CObject[N]; [/code] Or better yet, use the vector container class if …

Member Avatar for RandV80
0
109
Member Avatar for ramukneevan

Your question is vague enough that if you have special needs, a direct answer isn't going to be what you want (especially since the most direct answer is "What have you tried?"). So how about you tell us exactly what you're doing so we can offer more appropriate advice.

Member Avatar for Narue
0
61

The End.