6,741 Posted Topics

Member Avatar for microlatina

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?

Member Avatar for microlatina
0
120
Member Avatar for king03

[B]>ctrLet[ctc]++;[/B] ctc is an int, which is fine. But ctrLet is also an int. The int type does not support indexing.

Member Avatar for Arbus
0
8K
Member Avatar for montjoile

[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 …

Member Avatar for montjoile
0
365
Member Avatar for reza.adinata

[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]

Member Avatar for reza.adinata
0
385
Member Avatar for chhabraamit

[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?

Member Avatar for Narue
0
313
Member Avatar for steven woodman

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 …

Member Avatar for happygeek
-3
259
Member Avatar for Labdabeta

Your question is: does prefixing [iCODE]this[/iCODE] to member access have a performance cost? The answer is no, it should not.

Member Avatar for Labdabeta
0
105
Member Avatar for LesterTheGreat
Member Avatar for Batch File

[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 …

Member Avatar for Batch File
0
154
Member Avatar for eman 22

[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.

Member Avatar for Narue
0
86
Member Avatar for aplh_ucsc

[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.

Member Avatar for Narue
0
39
Member Avatar for ssesham1

[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. :)

Member Avatar for thekashyap
0
435
Member Avatar for Soubhik

[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 …

Member Avatar for Soubhik
0
216
Member Avatar for CloudZELL91

You sound incredibly lazy. Seeing as this is a trivial program, try it yourself first.

Member Avatar for CloudZELL91
0
82
Member Avatar for learningcpp

[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.

Member Avatar for learningcpp
1
3K
Member Avatar for The_Prince

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.

Member Avatar for mrnutty
0
172
Member Avatar for garap

[URL="http://eternallyconfuzzled.com/tuts/algorithms/jsw_tut_sorting.aspx#insert"]Clicky[/URL].

Member Avatar for Narue
0
44
Member Avatar for Dhanesh10

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 …

Member Avatar for Dhanesh10
0
369
Member Avatar for tennis

[ICODE]a[/ICODE] and [ICODE]b[/ICODE] are completely separate objects. I think you may have misunderstood the point of inheritance.

Member Avatar for Narue
0
103
Member Avatar for mirkuh

I don't have that problem at all using your classes. Can you post a complete program that exhibits the issue?

Member Avatar for Narue
0
112
Member Avatar for scarcella

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 …

Member Avatar for Narue
-1
346
Member Avatar for yashsaxena

[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 …

Member Avatar for yashsaxena
0
217
Member Avatar for Abel123

[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.

Member Avatar for jingda
0
709
Member Avatar for VernonDozier

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) { …

Member Avatar for VernonDozier
0
206
Member Avatar for MareoRaft
Member Avatar for VernonDozier

[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 …

Member Avatar for VernonDozier
0
332
Member Avatar for TomaCukor

[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 …

Member Avatar for Schol-R-LEA
0
137
Member Avatar for ricardo.crudo

[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?

Member Avatar for Narue
0
95
Member Avatar for marrkee

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]

Member Avatar for marrkee
0
114
Member Avatar for anjoz

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: …

Member Avatar for Narue
-1
551
Member Avatar for Jsplinter

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 …

Member Avatar for Narue
0
116
Member Avatar for Portgas D. Ace

[QUOTE]So much time just to relax, the easy life.[/QUOTE] Clearly you've never worked in IT before. ;)

Member Avatar for Capt. Fantastic
0
208
Member Avatar for nnaaddrr

[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:

Member Avatar for Narue
-2
120
Member Avatar for illuminatus89

[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 …

Member Avatar for Narue
0
110
Member Avatar for wmc1956

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.

Member Avatar for jingda
0
87
Member Avatar for masterjiraya

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.

Member Avatar for masterjiraya
0
476
Member Avatar for Warl30ck

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.

Member Avatar for Narue
0
315
Member Avatar for shimooli

[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, …

Member Avatar for Narue
0
173
Member Avatar for sharma89bunty

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.

Member Avatar for mtatadotcom
1
86
Member Avatar for arun srinivaas

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 …

Member Avatar for pseudorandom21
0
65
Member Avatar for element432

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 = …

Member Avatar for element432
0
128
Member Avatar for kadhaipaneer

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]

Member Avatar for vijayan121
0
142
Member Avatar for ifiok.idiang
Member Avatar for Derek Elensar
Member Avatar for Muhammad Anas

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]

Member Avatar for Muhammad Anas
0
266
Member Avatar for lochnessmonster

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?

Member Avatar for vijayan121
0
120
Member Avatar for zeeshannetwork
Member Avatar for jingda

[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 …

Member Avatar for Rik_
0
309
Member Avatar for creck

Class definitions end with a semicolon. Yours does not, and the compiler is interpreting that as a part of the return type for main.

Member Avatar for Narue
0
83
Member Avatar for C++NewBe

[ICODE]double temperatures[MaxDays][MaxTimes];[/ICODE], perhaps? Is this a trick question, or do you not own a book on C++?

Member Avatar for YOUSAFZAI
0
123

The End.