6,741 Posted Topics

Member Avatar for agunning

>double Net(double n,double *i); >double Pension (double *p, double n); >double taxable (double *t, double i, double n, double p); >double taxdue (double *td, double *t); These aren't function calls, they're function declarations. You call those functions like so: [code=c] Net ( n, &i ); Pension ( &p, n ); …

Member Avatar for Narue
0
83
Member Avatar for Mossiah

Holy crap, it feels like every question these last few days has been about runtime sized arrays. :icon_rolleyes: >But it does not work. Right. C++ requires that the size of an array be a compile-time constant. You can't use the value of a variable unless it's also declared const. The …

Member Avatar for Narue
0
164
Member Avatar for vijaypaigwar

[code=c] void foo ( int a[3][3] ); int main ( void ) { int a[3][3]; foo ( a ); } [/code] If you want a better answer, ask a [URL="http://www.catb.org/~esr/faqs/smart-questions.html"]smarter question[/URL].

Member Avatar for Narue
0
43
Member Avatar for MJ Pieterse
Member Avatar for MJ Pieterse
0
152
Member Avatar for molomoss

Why are you trying to convert to a static array? The dynamic array is much more flexible, seeing as how you don't know how many records will be read from the file. It seems to me that you're taking a giant step backward in robustness. You might notice this robustness …

Member Avatar for Narue
0
202
Member Avatar for xgmx

If you didn't bump it back to the top of the thread list, nobody would ever see it again.

Member Avatar for Ezzaral
-1
264
Member Avatar for serkan sendur

>none of the opponent ideas has changed my thoughts. Do you want a cookie or something? >i am not a cheater because i say cheating must be supported legally Wait, let me get this straight. You support cheating as being the most ethical thing, but you turn around and say …

Member Avatar for serkan sendur
0
178
Member Avatar for nschessnerd

Assuming you're working on Windows, learn about the PE (portable executable) file format and you can easily extract the information you want either manually or with any number of disassembly tools.

Member Avatar for nschessnerd
0
81
Member Avatar for daviddoria

static_cast is [B]designed[/B] to painful, which encourages you to avoid casting when you might otherwise say "why not?". Another reason I've heard is that it's easier to search for a cast, while the (type) pattern is also seen in non-cast syntax. I have yet to see a case where I've …

Member Avatar for Narue
0
102
Member Avatar for dollycharm

>What is the difference between a well-formed XML document and a 'valid' XML document? Well formed XML is syntactically correct (ie. a parser won't choke on it) and valid XML is semantically correct based on a provided schema. See [URL="http://www.w3schools.com/Xml/xml_dtd.asp"]here[/URL] for more details.

Member Avatar for Narue
0
122
Member Avatar for Hiroshe

There are two generally accepted ways to split a number into digits. First is the string conversion: [code=c] #include <stdio.h> int main ( void ) { int value; printf ( "Enter an integer: " ); fflush ( stdout ); if ( scanf ( "%d", &value ) == 1 ) { …

Member Avatar for Hiroshe
0
171
Member Avatar for rom87

delete frees the memory up for other uses. Just because that memory isn't immediately used after deleting doesn't mean you can safely access it.

Member Avatar for Ancient Dragon
0
77
Member Avatar for massivefermion

>Come on man,I considered c++ programmers smarter. In my experience C++ programmers are just like everyone else: the majority are slightly below average, a smaller number are average or just above, there are enough retards to frighten you, and a handful are truly brilliant. By the way, you're not that …

Member Avatar for Narue
0
144
Member Avatar for daviddoria

>Can you see what I'm trying to do? You're trying to use the same function to properly handle two incompatible types. A three dimensional array is not the same as a pointer to a pointer to a pointer. A template is the ideal solution for this problem, assuming you can …

Member Avatar for Narue
0
311
Member Avatar for smith2009

>why dont you learn more common php or asp.net instead of cold fusion? Because he already knows PHP and ASP.NET? Because his employer requires him to learn ColdFusion? Because there aren't as many ColdFusion programmers and he could make bank by becoming one? Because he's simply interested in it and …

Member Avatar for blackpooldanny
0
99
Member Avatar for belac_88

Okay Caleb, or Claire, or whoever the hell you claim to be, let's keep [URL="http://www.daniweb.com/forums/thread181971.html"]IDENTICAL FREAKING QUESTIONS[/URL] to a single thread, mkay?

Member Avatar for Narue
0
74
Member Avatar for Spanki

Posting your assignment is more likely to attract flames than any useful help. Daniweb is not rentacoder.

Member Avatar for Narue
0
101
Member Avatar for csinquirer

>How complicated should a program be for you to >make plans for it (eg. flowcharts, drafts, etc)? Anything more complicated than the hello world program. >When do you just jump into coding with just a vague >idea of how a program is supposed to run? When I'm prototyping. However, for …

Member Avatar for Narue
-1
81
Member Avatar for bussaina
Member Avatar for Dewey1040
0
75
Member Avatar for krutthika

You're asking in the wrong place. Daniweb is for people who do their own work.

Member Avatar for monkey_king
0
102
Member Avatar for serkan sendur

Amazing. Visiting the Geeks' Lounge is like sitting in a room full of children.

Member Avatar for Ancient Dragon
1
668
Member Avatar for FlamingClaw

If you're sure the problem really has been solved, you can contact a moderator in that forum. We're able to set threads as solved if necessary.

Member Avatar for FlamingClaw
0
51
Member Avatar for a_n_n_a_m

You xpath isn't returning the parent at all, it's returning the matching elements with that text. Because multiple elements match the criteria, you get multiple results for each parent element. If you return the parent itself, you'll only get one result: [code=xpath] //year/*/*[contains(., '$string')]/parent::* [/code]

Member Avatar for Narue
0
240
Member Avatar for demonic_death

>I don't get anything back from selectNodes. Because what you're asking for isn't what you intended to ask for. Let's break it down: >//book[@id='bk102'] This is okay, it selects the book element with an id attribute that matches the string 'bk102'. So far so good. >//book[@genre ='Other'] book doesn't have …

Member Avatar for Narue
0
73
Member Avatar for slik33

>int size=0; >int *parr= new int[size]; For starters, size isn't a compile-time constant, which means you're relying on a compiler extension and your code is thus non-portable. Next, an array of zero size is unlikely to be what you want. The error you're getting generally means that you've written outside …

Member Avatar for Narue
0
124
Member Avatar for Raschoc

You define MARITALSTATUS twice before passing to FEDTAX: first as a global int, then a local char in main. You also redefine it [i]again[/i] in your FEDTAX function, which means the value you passed will never be used. These problems alone should be enough to cause you fits. Also make …

Member Avatar for Raschoc
0
122
Member Avatar for Mossiah

>Thank you for your help. You neglected to ask a specific question. Allow me to show you what your "question" looks like to me: [quote] I have this program that works but my teacher wants me to do it without using globals. Do it for me and give me the …

Member Avatar for Narue
0
73
Member Avatar for Alerwi

[code=c] int i; for ( i = 0; subjeCode[i][0] != '\0'; i++ ) { if ( strcmp ( subjeCode[i], input ) == 0 ) break; } if ( subjeCode[i][0] != '\0' ) { /* Found */ } else { /* Not found */ } [/code]

Member Avatar for Narue
0
71
Member Avatar for papuccino1

>What do you mean, the "SQL end"? Or "the application end"? >I don't understand those terms. I think they're rather self-explanatory. Are you being intentionally obtuse again? >Do I have to program those SQL files on the aplication end, or on the SQL end? You program them wherever you want, …

Member Avatar for papuccino1
0
140
Member Avatar for Lenny19

You have the right idea, though the actual code you posted won't compile. I'd give you an example, but I can't do so without solving the problem for you, sorry.

Member Avatar for Narue
0
112
Member Avatar for maru2

>should I put the starting bracket on the next line Whichever you find easier to read. >should I use ++i or i++ For built-in types, it doesn't matter. For user-defined types, the prefix increment is preferred. If you have trouble remembering that guideline, always use the prefix form when the …

Member Avatar for Narue
0
119
Member Avatar for Mahsa_C++

The map class uses an overloaded operator< for maintaining the relation between keys. Your Student class doesn't have this overloaded operator. That should give you a starting point for researching a solution.

Member Avatar for Mahsa_C++
0
95
Member Avatar for cloud21

>Then, you could define 4 derived classes, "SpadeCard", >"HeartCard", "DiamondCard" and "ClubCard". You really think a class for each suit is necessary? Do you suggest making a separate class for each value too? :icon_rolleyes: There's not enough complexity in a standard deck of cards to justify inheritance, so perhaps the …

Member Avatar for VernonDozier
0
209
Member Avatar for maru2

I think you're asking the wrong question. The right question would be (assuming 8 byte doubles), why are you trying to eat over [B]16 gigabytes[/B] for a single vector? The naive approach isn't likely to work in this case, you need to consider alternative algorithms that don't waste so much …

Member Avatar for StuXYZ
0
216
Member Avatar for serkan sendur

I believe niek_e was suggesting you show us where the demand for a new forum is. If we added a specialized forum at the whim of every noob with a new hobby, Daniweb would become so diluted as to be useless.

Member Avatar for Rashakil Fol
0
192
Member Avatar for verruckt24

>The point I want to make over here is, can't we have some >auto-marking mechanism for threads which identifies the time the >last post was made onto a thread and if this is more than some >pre-specified value mark the thread as "solved". What makes you think the new member …

Member Avatar for verruckt24
0
462
Member Avatar for snap!

>dunno where to start This means you're overwhelmed with the complexity of the task. Break it down into smaller, simpler tasks until you aren't overwhelmed. Then solve them individually and put them together to get the final program.

Member Avatar for StuXYZ
0
92
Member Avatar for ace_dman

It looks like you're confused about the arrow operator. This: [code=cplusplus] pointer_to_struct->member [/code] is equivalent to this: [code=cplusplus] (*pointer_to_struct).member [/code] It's just a convenient notation for merging a dereference and member access into one.

Member Avatar for ace_dman
0
103
Member Avatar for ~s.o.s~

Pascal's triangle is boring. How about something more fractalish: [code] #include <iomanip> #include <iostream> using namespace std; int main() { int rows = 16; for ( int i = 0; i < rows; i++ ) { cout<< setw ( rows - i - 1 ) <<""; for ( int j …

Member Avatar for creeping death
0
726
Member Avatar for colmcy1
Member Avatar for etc123

>Is this valid?.. #pragma warning(disable:'warn code') ..:p If you don't know what's causing a warning, you'd be a fool to disable it. I only know of one warning, on any compiler that I've ever used, where I'm 100% sure that it can be safely disabled. The correct response to a …

Member Avatar for mitrmkar
0
444
Member Avatar for yuvaraj.tr

You can, but you'll probably get a conversion warning and the result will be forced into a boolean range (in the case of int, zero is false and non-zero is true).

Member Avatar for monkey_king
0
130
Member Avatar for soulreaver20500

That's what this forum is for. An added benefit is you have many people with different experience and perspectives who can help you and keep each other from making mistakes when helping you.

Member Avatar for Narue
0
148
Member Avatar for Ψmon

You can't assign to arrays like that. In this case you're pretty much stuck with copying the contents of the string literal to the array manually or with a function like strcpy that does it manually: [code=cplusplus] #include <iostream> #include <cstring> struct StudentRecord { char Name[20]; // (1) int ID; …

Member Avatar for Ψmon
0
168
Member Avatar for AlSal

Cast it: [code=cplusplus] #include <iostream> void f(int* x) { std::cout<<"int*\n"; } void f(char* x) { std::cout<<"char*\n"; } int main() { f((char*)0); f((int*)0); //f(0); } [/code]

Member Avatar for Narue
0
103
Member Avatar for serkan sendur

I'm not sure I understand the question. Are you trying to find our first posts on Daniweb, or are you asking why we didn't first post to the Geeks' Lounge?

Member Avatar for Narue
0
309
Member Avatar for NagendraR

If you're struggling, duplicate your declaration: [code] void foo ( int *arg[2][3] ); int main ( void ) { int *ptr[2][3]; foo ( ptr ); return 0; } [/code] Within foo, you use arg just as you would use ptr unless you're trying to use sizeof, in which case you …

Member Avatar for tux4life
0
242
Member Avatar for BobLewiston
Member Avatar for MentallyIll5150

& applies to the type, not the name: [code=cplusplus] int& dequeint::pos(void) [/code]

Member Avatar for Narue
0
94
Member Avatar for olicat

>What do you think I should do? I think you should stop being so afraid of your direct supervisor and confront him with your concerns. I mean really, what do you expect us to do about it? If someone is supposed to train you and isn't, that's negligence on his …

Member Avatar for ItCareerCoach
0
216

The End.