6,741 Posted Topics
Re: Subscriptions and such can be edited from your control panel, but the specifics depend on exactly what you're thinking of as the subscription. So, unsubscribe from what, exactly? | |
Re: [B]>ctrLet[ctc]++;[/B] ctc is an int, which is fine. But ctrLet is also an int. The int type does not support indexing. | |
Re: [QUOTE]I think this is caused by malloc, or something else.[/QUOTE] It's caused by something else. That something else is you misusing malloc. Tell me, what is sizeof(btree) and what makes you think it's equal to sizeof(nodo)? Allocating less memory than you use is a good way to corrupt the memory … | |
Re: [B]>if(p->value = a)[/B] Two things: [list] [*]Comparison is done with the == operator. The = operator is for assignment. You're doing the equivalent of this: [code] p->value = a; if (p->value != 0) [/code] [*]You've already advanced p at this point, so how do you know it's not NULL? [/list] | |
Re: [QUOTE]Please elaborate by simple example.[/QUOTE] No, [I]you[/I] elaborate first. What kind of I/O? Are you doing type conversions like scanf and printf? Do you know about the unformatted I/O functions? Have you profiled your code and confirmed that C's standard I/O is too slow? | |
Re: Please take this little spat to PM. Steve, if you have a specific complaint then send me a PM with the details and I'll take a look. However, concerning the Viruses, Spyware and other Nasties forum, we've recently tightened up the rule set. Due to the potential damage to OP … | |
Re: Your question is: does prefixing [iCODE]this[/iCODE] to member access have a performance cost? The answer is no, it should not. | |
Re: We don't do homework problems for lazy students. | |
Re: [QUOTE]its just text![/QUOTE] Yes, yes it is. C++ is a compiled language, which means you need a compiler and linker to turn that text into executable machine code. The easiest way to get started is with an IDE. You'll be able to create projects and build them with the click … | |
Re: [QUOTE]I tried if(a[i]==NULL) but it doesn't work[/QUOTE] Have you tried initializing the array to null pointers? Then that test would work. | |
Re: [QUOTE]Will daniweb add a thread category for Augmented reality.[/QUOTE] Probably not. New forums are only added when there's sufficient demand for a certain topic, no good place for discussions of that topic presently available, and noticeable benefit to the community. | |
Re: [QUOTE]Is it possible for me to define the template function in an implementation source file instead of defining it inside the class?[/QUOTE] The short answer is no. The long answer is still no, but it's a longer no, so I'll stick with the short answer. :) | |
Re: [QUOTE]a> Where are the actual functions?[/QUOTE] Linked into the compiler as either static libraries or dynamic libraries. [QUOTE]b> How do I write a header file such that the actual functions are separately stored?[/QUOTE] The header file should contain only declarations. You'll provide definitions in a separate .c file that is … | |
Re: You sound incredibly lazy. Seeing as this is a trivial program, try it yourself first. | |
Re: [QUOTE]why dynamic argument deduction deducting it as normal integer?[/QUOTE] Top level CV qualifiers are stripped during the type deduction. That's actually expected behavior for template function parameters that aren't a pointer or reference. | |
Re: Use the simplest method until you can prove that it doesn't perform well enough for your needs. A vector of vectors will probably be the simplest, and should also be sufficiently fast, but there's no way of knowing until you've profiled it with a realistic data set. | |
Re: [URL="http://eternallyconfuzzled.com/tuts/algorithms/jsw_tut_sorting.aspx#insert"]Clicky[/URL]. | |
Re: If you don't supply an explicit return type for a function, the compiler assumes that you meant int. So your declaration is: [code] void add_end(struct node **q); [/code] And your definition with the implicit int added is: [code] int add_end(struct node **q) { [/code] That's the mismatch. Place a void … | |
Re: [ICODE]a[/ICODE] and [ICODE]b[/ICODE] are completely separate objects. I think you may have misunderstood the point of inheritance. | |
Re: I don't have that problem at all using your classes. Can you post a complete program that exhibits the issue? | |
Re: For the record, installing Mac OS on any hardware other than that provided by Apple is against the EULA, and thus against Daniweb's rules for discussion. This includes emulators. Please refrain from offering help in installing Mac OS on non-Apple hardware, and it would be helpful if questions asking how … | |
Re: [QUOTE]I have confusion with how many vitual pointer and virtual table for a single class are created?[/QUOTE] Each [I]class[/I] has a virtual table and each [I]object[/I] has a pointer to that table. [QUOTE]And if the class is inheriing some other then what will be the situation?[/QUOTE] If there's no inheritance … | |
Re: [QUOTE]abelLazm is a great contributer to this forum![/QUOTE] There isn't a double standard. Anyone who breaks the rules, regardless of contributions thus far, will suffer the same consequences as J. Random Poster on day one. It's not about being mean, it's about being fair. | |
Re: C++ requires a cast for conversions to and from void*: [code] SInt8 one_net_memcmp(const void* const vp1 , const void * const vp2, size_t n) { const UInt8 * up1; const UInt8 * up2; // If invalid, just return zero since there is no error recovery if (!vp1 || !vp2) { … | |
Re: istringstream is declared in the <sstream> header. | |
Re: [QUOTE]What's the problem and how can I fix it?[/QUOTE] const in C doesn't mean the same thing as const in C++. In C, the object is read-only at the source level, but does not constitute a compile-time constant like it does in C++. Your error is coming from this clause … | |
Re: [QUOTE]itoa() is deprecated, and is not part of the standard library[/QUOTE] The second part is correct, the first part is not. itoa was never part of the standard library, and thus cannot be deprecated. Deprecated means that a feature of the standard is slated for future removal; it's still standard … | |
Re: [QUOTE]I need that the result of concatenation be: B1200, B2400, B9600, ...[/QUOTE] How do you expect to get the runtime value of BAUDRATE_VAL[i] at compile time? | |
Re: Wow, how vague. I'm assuming you have a string literal and want to put a double quote inside of it. In that case you escape it with a backslash: [code] cout<<"I'm a \"quoted\" string\n"; [/code] With character literals the escape is not needed: [code] cout<<"I'm a "<<'"'<<"quoted"<<'"'<<" string\n"; [/code] | |
Re: sizeof(char) is guaranteed to be 1, so you can remove that part of the expression. You should also add 1 for the null character at the end, otherwise your string will be limited to length-1 characters, which can be confusing. p.s. Your code is quite broken. Here is a correction: … | |
Re: Since it's a random access iterator, you can take the difference of the two to get the distance between them: [code] i = myvec.end() - it; [/code] However, this requires a random access iterator. If you decide to change the container to a list, for example, the trick no longer … | |
Re: [QUOTE]So much time just to relax, the easy life.[/QUOTE] Clearly you've never worked in IT before. ;) | |
Re: [QUOTE]if you need the program for the university you can call him any time at his mobile phone.[/QUOTE] I'm trying to fathom how you thought posting another person's telephone number was a good idea. :icon_rolleyes: | |
Re: [B]>#define COL 10001 >#define ROW 5000 >long int a[ROW][COL];[/B] Let's see, 10001 * 5000, multiply that by 4 on the assumption that your longs are 32-bit, and you've got a single object on the stack taking up ~190MB. I'm confident that the default stack size for your compiler is significantly … | |
Re: The Windows version was not mentioned, so I'm assuming either Vista or 7 in moving this thread. If that's not a correct assumption, please report the thread so that it can be moved to the correct forum. | |
Re: Daniweb already has an unwieldy number of forums and subforums, so while we're not against adding a new forum, there has to be obvious and significant benefit to justify the addition. In all honesty, I don't see Razor as making the cut at this point. | |
Re: strtok modifies the source string. You have no choice but to make a copy if the original string can't be modified. It also looks like you need to study about arrays a bit. | |
Re: [QUOTE]Now, how can i save the binary tree onto the hard disk, and how can i rebuild it from the hard disk ?[/QUOTE] Well, obviously you need to devise some kind of format, but the easiest method is with record ordering. You can treat serialization as an extension of copying, … | |
Re: scanf expects a pointer: [code] scanf("%d", &marks); [/code] It's a wonder that your code runs long enough to have odd behavior in the if statement. | |
Re: The first is a reference to const int, the object being referenced is const. The second is a const reference to int, the reference itself is const. However, a const reference is nonsensical because references are permanently bound to a single object on definition. To have a const reference implies … | |
Re: You're returning on the first iteration, so the result of [ICODE]factorial(5)[/ICODE] is essentially [ICODE]5 * 5[/ICODE]. A correction would initialize [ICODE]i[/ICODE] to [ICODE]n - 1[/ICODE], and only return [ICODE]n[/ICODE] after the loop: [code] int factorial(int n) { for (int i = n - 1; i >= 1; i--) n = … | |
Re: Arrays must have a size. If your goal is an array with unknown or variable size, I'd recommend an std::vector: [code] #include <vector> struct mystruct { int val; int num; std::vector<std::string> state; std::vector<mystruct*> next; }; [/code] | |
Re: Been there, done that. What's [U]your[/U] answer? | |
Re: Look again. Where are you defining check[B][I]_answer[/I][/B]? | |
Re: Pointers to char are assumed to be C-style strings by cout. You can force them to be interpreted as pointers by casting to void*: [code] cout<< (void*)p <<'\n'; [/code] | |
Re: Yes, I know. And it's easily the most complex part of the standard C++ library. How many hundreds of pages do you expect for a complete description of everything that's going on? | |
Re: [QUOTE]Is my understanding correct ?[/QUOTE] Yes. | |
Re: [QUOTE]I agree with WaltP here.[/QUOTE] Me too, but only to a point. Legitimate difficulties of a non-native speaker are easy to spot and given appropriate slack. For example, things like doubt vs. question chafe, but are written off as a quirk of non-native speakers and mostly ignored. Lazy and sloppy … | |
![]() | Re: Class definitions end with a semicolon. Yours does not, and the compiler is interpreting that as a part of the return type for main. |
Re: [ICODE]double temperatures[MaxDays][MaxTimes];[/ICODE], perhaps? Is this a trick question, or do you not own a book on C++? |
The End.