5,237 Posted Topics

Member Avatar for l1985

Try adding \n to your debug printf statements, or follow the printf with [ICODE]fflush(stdout);[/ICODE]

Member Avatar for Salem
1
102
Member Avatar for monstro

> but structs and unions are instantiated in a fixed order? Is this true? Where can I find this information? Yes (for C anyway), members of a struct are arranged through memory in the order in which you declare them. What you have little control over however is what the …

Member Avatar for Duoas
0
186
Member Avatar for CoolGamer48

How about [code] if(m_velocity.x == 0) { result = 0; } else { result = ToDegrees(atan(m_velocity.y/m_velocity.x)); } return result; [/code] Seconds spent over-optimising what any half-decent compiler will manage to do just fine can save days of debugging time later on. Sure, the code looks just like that now, but …

Member Avatar for Salem
0
144
Member Avatar for jagatsastry

I thought it was __LINE__ __FILE__ [url]http://gcc.gnu.org/onlinedocs/cpp/Standard-Predefined-Macros.html#Standard-Predefined-Macros[/url]

Member Avatar for jagatsastry
0
218
Member Avatar for greg6666

So what do you want us to do about it? Do you have a C compiler which targets your processor? The GCC compiler does - [url]http://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/Submodel-Options.html#Submodel-Options[/url] Having found that, does your existing algorithm have adequate performance without resorting to hand-crafting fixed point for everything? As a first step, I would …

Member Avatar for Salem
0
151
Member Avatar for InfinityArc

[code] void Sailboat::Calcfee(double _z) { double LOA = length; if (commercial = false) { _z = LOA*50; } if (commercial = true) { _z = LOA*50+7.5; } } [/code] This function doesn't do anything, and it still does it wrong. Use == for comparison, not = In fact for boolean, …

Member Avatar for InfinityArc
0
133
Member Avatar for web_master

Your i+1 means you're reading off the end of the array. Also, finding the maximum is a lot simpler than this.

Member Avatar for varsha0702
0
98
Member Avatar for mertucci

You don't specify the types when you call the function. [ICODE]hesap.arith_ex(x,y , z);[/ICODE] But you also have no x,y,z to pass to the function either.

Member Avatar for mertucci
0
124
Member Avatar for 26933

Iteration is when the same question keeps getting [URL="http://cboard.cprogramming.com/showthread.php?t=82839&highlight=iteration"]asked[/URL] Recursion is when the same question gets [URL="http://www.daniweb.com/forums/thread124395.html"]answered[/URL] ;)

Member Avatar for Salem
0
157
Member Avatar for SpecialeW

Keep a diary of which programs you actually use in any session. Then delete all the crap from your startup which you don't consistently use in every session.

Member Avatar for Salem
0
159
Member Avatar for som3on3

[code] std::map <std::string, std::string> array; array["fruit"] = "apple"; [/code]

Member Avatar for som3on3
0
116
Member Avatar for midimatt

Well if you declare the pointer the right way, then yes you can allocate the whole 2D array in one step. [ICODE]float (*vertices)[3];[/ICODE] But this only works when all the minor dimensions are constants. BTW - Use [ICODE]std::vector[/ICODE] in C++.

Member Avatar for bugmenot
0
133
Member Avatar for yazooney

> i want to take information (i.e. strings) from an existing program How do you know it stores strings? Just because you see strings on screen doesn't mean it stores those same strings internally for any length of time. Routing the program's net connection through your own little proxy would …

Member Avatar for Salem
0
138
Member Avatar for kux

> what about solving little/big endian problem by doing appropriate typecast before writing to file? Because endian can't be fixed with a simple cast. You have to write code to rearrange the bytes into the correct order. > Is there any standard function to test the endianess of the system? …

Member Avatar for Salem
0
195
Member Avatar for bhargsy

Do you also have a makefile in the parent directory, which runs the two sub-directory makefiles, then combines both results into a single program? In each sub-dir makefile, you could set the compiler options to also have [ICODE]-I../DIR_B[/ICODE] as an additional search path.

Member Avatar for bhargsy
0
87
Member Avatar for andy_aphale

So post your best attempt. Who knows, you may be closer than you think.

Member Avatar for Salem
0
144
Member Avatar for bhuwanrc
Member Avatar for nagaa

Well checking the integrity of say a JPG file would be different from say a WMV file.

Member Avatar for Ancient Dragon
0
136
Member Avatar for latour1972
Member Avatar for RyanLeaf
Member Avatar for Dannyo329

The forum is littered with examples, it shouldn't take too long to find something.

Member Avatar for Laiq Ahmed
0
162
Member Avatar for jibujacob
Member Avatar for nurulshidanoni

Why are you still using void main? [url]http://www.research.att.com/~bs/bs_faq2.html#void-main[/url] [url]http://c-faq.com/ansi/maindecl.html[/url] It's wrong pure and simple, and just because your compiler accepts it doesn't make it any more right. Plus, you need to work on your indentation as well. If it looks better in your IDE (everything lined up nicely) than in …

Member Avatar for Arpy Giri
0
170
Member Avatar for blainer27

First I would suggest you create a 'printList' function which prints out the entire list in detail, so you can easily confirm it's structure at any point in the program. Second, start by testing known expressions. Third, the block of code which deletes two nodes in result of evaluating 'a' …

Member Avatar for Salem
1
77
Member Avatar for Spagett912

Is there anything wrong with the output of [ICODE]g++ -S prog.cpp[/ICODE] Use it as a guide for your own attempt.

Member Avatar for Spagett912
0
248
Member Avatar for 3m4d
Re: help

> With Q4 the answer is D 12.0 but if u work it out you get 12.5 ?? Think about the difference between integer division, and float division. Which applies in this case? > else cout>>"there" Consider which of the 'if' statements this else statement binds to?

Member Avatar for hammerhead
0
369
Member Avatar for harsh2327

It's because your crusty old Turbo C (which is like a decade out of date) doesn't understand the long filenames of your nice new OS (which is it, XP or Vista?). Get a compiler which is good for this millenium, and compatible with the win32 API. A popular choice would …

Member Avatar for harsh2327
2
297
Member Avatar for usmanabb
Member Avatar for jbennet
0
552
Member Avatar for gljiva18

Which Operating System / Compiler / Graphics library are you using? Have you (for example), got as far as say drawing a line and changing it's colour?

Member Avatar for Salem
0
26
Member Avatar for vinz4ever
Member Avatar for nabeelcool17

Well 'graphics' is a bit vague, what sort of graphics? Perhaps a thermometer, running from 'green' to 'red' depending on how much energy has been used. Or perhaps a series of measurements plotted as a line graph. Now, what do YOU mean by graphics?

Member Avatar for nabeelcool17
0
91
Member Avatar for notbadday

[url]http://clusty.com/search?query=mp4+file+format&sourceid=Mozilla-search[/url] Maybe refine the search with terms like "source code" or "library"?

Member Avatar for Salem
0
86
Member Avatar for Black Magic

Use cin.getline() to read all your input, then you don't get caught up with all the left-over characters normal cin >> var leaves behind.

Member Avatar for Nick Evan
0
138
Member Avatar for hassanawdah

[url]http://www.daniweb.com/forums/announcement125-2.html[/url] [url]http://www.catb.org/~esr/faqs/smart-questions.html#homework[/url]

Member Avatar for Salem
0
270
Member Avatar for lozzam

> I can see from the screen dump that d0 contains A And that is the same as 10 decimal. Perhaps read the documentation to find out what other services those trap #14's offer. If there is nothing, then you'll have to convert the number to a printable string yourself.

Member Avatar for Salem
0
121
Member Avatar for manzoor

It means they're allocated by the compiler when you compile the program, not when you run the program.

Member Avatar for Sky Diploma
0
847
Member Avatar for GigaCorp
Member Avatar for GigaCorp
0
160
Member Avatar for edek

> Terminates with: 'No source available for "fclose@@GLIBC_2.1() " ' You get these in debug builds because the code for fclose uses assert() to validate the input parameters. If you were in a debugger at the time, you'd know exactly where to start looking. In this case, fclose() is likely …

Member Avatar for edek
0
459
Member Avatar for xlx16

It's the non-reply to their other [URL="http://www.daniweb.com/forums/thread123528.html"]thread[/URL]

Member Avatar for Nick Evan
0
125
Member Avatar for RaDeuX

Using more { } to denote exactly which bits of code belong to which block would certainly help clarify the problem.

Member Avatar for RaDeuX
0
260
Member Avatar for xlx16

First [url]http://www.catb.org/~esr/faqs/smart-questions.html#writewell[/url] Then perhaps [url]http://www.catb.org/~esr/faqs/smart-questions.html#beprecise[/url] Then restate your question in English (not kiddie script), and state the Operating system and compiler you want this to run on. And try to be more specific than say "windows" and "borland" for example.

Member Avatar for Ancient Dragon
0
230
Member Avatar for Seamus McCarthy

> infile >> numbers[capacity]; This doesn't fill the array for you, you have to do that yourself with a loop. All this does it trash beyond the end of the array.

Member Avatar for compumasta
0
100
Member Avatar for Vipuljain

So are you using a cross-platform GUI toolkit such as wxwidgets? How much GUI programming have you actually done up to now?

Member Avatar for Salem
0
32
Member Avatar for knish
Member Avatar for Salem
0
52
Member Avatar for tarakant_sethy

Start with a loop which searches forward 'pos' nodes or until the end of the list. Can you do that much?

Member Avatar for Luckychap
0
122
Member Avatar for RyanLeaf

Why not try using it for yourself and find out? Depends what sort of beginner you mean. - experienced programmer who wants to "begin" to program in assember - probably fine - utter noob who only figured out how to turn on the machine a few days ago and wants …

Member Avatar for Salem
0
341
Member Avatar for edek

Pipes are part of the POSIX operating system, and nothing to do with the language. As for classes, maybe - I dunno. I've reached my google quota for the day.

Member Avatar for Nick Evan
0
214
Member Avatar for kracer15
Member Avatar for Salem
0
40
Member Avatar for Prabakar

Strings are a pointer type (char * or more recently const char *), so yes you can use the subscript operator on them.

Member Avatar for Prabakar
0
156
Member Avatar for nelledawg

> fp = fopen(“data.dat”, “ab”); What sort of quotes are these? > show(); show() expects a lot of parameters. Next time, post error messages. Also, when you've got something which does something useful, make a copy of it.

Member Avatar for nelledawg
0
101

The End.