6,741 Posted Topics

Member Avatar for LeoC++

What version of Windows? Is it 32-bit or 64-bit? What compiler and version? There's nothing wrong with your code, and I have heard of this error on Windows 7 before. Have you tried using compatibility mode, and does it still fail?

Member Avatar for LeoC++
0
123
Member Avatar for nkinar

The operator= you define is for the Vertex class. It only applied when you assign something to a Vertex object. What you apparently want is an implicit conversion: [code] class Vertex { public: Vertex(); operator double() { return value; } private: double value; }; [/code]

Member Avatar for nkinar
0
103
Member Avatar for Ain_ee

What did you do to solve your problem before running here with your tail between your legs?

Member Avatar for Narue
0
36
Member Avatar for mccbebz

>i prefer using C cause im much familiar with C programs.. Clearly you aren't. >#include<conio.h> Please don't waste your time with this garbage. >#include<string.h> Why include a header that you're not using? >char names[10]; >int n; Global variables should be avoided. Also, names is poorly named as it defines a …

Member Avatar for harsh.varudkar
0
125
Member Avatar for zachattack05

[B]>Any thoughts?[/B] That feature already exists. If there are any approved tutorials for a forum you can find them under the "related forum features" box. As for submitting tutorials, I don't recall what the procedure is. Probably email or PM it to one of the admins for approval.

Member Avatar for zachattack05
0
77
Member Avatar for Chrisjj

I'm [I]not[/I] surprised that you ignored the obvious humor in said admin's response. To do so would surely cause your well reasoned suggestion to be mocked and ignored by everyone rather than nearly everyone. :icon_rolleyes: Let's also ignore that the infraction system is built into vBulletin and your complaints are …

Member Avatar for diafol
0
783
Member Avatar for Instinctlol

cin's overloaded >> operator returns a reference to the stream, which can in turn be used in a boolean context to determine the state. If you ask for a number and an invalid format is encountered, the stream enters an error state: [code] if (!(cin>> number)) { cout<<"Must enter a …

Member Avatar for VernonDozier
0
81
Member Avatar for Annettest

Perhaps I'm missing something and oversimplifying, but does this not work? [code] for (int vi = 0, mi = 0; vi < numRowsVector && mi < numRowsMatrix; vi += 3, mi += 3) { for (int i = 0; i < 3; i++) { m[mi][i] = v[vi + i]; } …

Member Avatar for Annettest
0
192
Member Avatar for miturian

[B]>How should I change that definition to make it accept the {, , ,} directly?[/B] Use a different language that supports such an overload or wait until C++0x comes out? You certainly have options, but the array initialization list isn't one of them. Your best option presently, in my opinion, …

Member Avatar for miturian
0
86
Member Avatar for naseerhaider

[B]>can some through some light that why is it behaving like this ?[/B] It would truly suck for testing if rand weren't default seeded to a predictable value. As such, if you don't call srand, the program will behave as if you called [ICODE]srand(1)[/ICODE]. [B]>time_t t; >time(&t); >srand(t);[/B] The one-liner …

Member Avatar for naseerhaider
0
168
Member Avatar for laehc

[B]>Well at least you didn't mention premature optimization.[/B] I suspect you get that a lot. Probably for good reason.

Member Avatar for laehc
0
164
Member Avatar for merse
Member Avatar for darrenbkl

Unless a member function is declared as static, you need an object instance to call it on: [code] a.PrintStack(a); [/code] You can either make it static, or change the member function to work on [ICODE]this[/ICODE] rather than a parameter: [code] void TIntStack::PrintStack() { unsigned i = HowMany(); for (unsigned j …

Member Avatar for Narue
0
2K
Member Avatar for daviddoria

[B]>it said can't cast double* to float*[/B] Certainly not with static_cast. For that you need either reinterpret_cast or a C-style cast. Either way, it's not a very good idea to blindly jump from a larger type to a smaller type. At the very least, a preliminary test for overflow would …

Member Avatar for Narue
0
2K
Member Avatar for coding101

[B]>Im not asking for the code, just and idea of what to do.[/B] The requirements outline your algorithm step by step. [B]>How would i point to the first charachter in the line[/B] [code] char *front = &line[0]; [/code] [B]>and the last to the rear?[/B] [code] char *rear = &line[len - …

Member Avatar for Narue
0
78
Member Avatar for miturian

C++ doesn't allow the binding of temporary objects to non-const references. Your overloaded operator+ is returning a temporary object, which you then try to pass as a non-const reference to the overloaded operator=. You can fix it by being const correct (a good idea anyway): [code] dummy& operator=(const dummy &rhs) …

Member Avatar for miturian
0
111
Member Avatar for Tirian

[B]>Everyone has told me to "Use Yacc/Lex" (or various variants >of them), but I really don't understand how they're useful.[/B] Then you don't know enough about how compilers work or how they're implemented. In such a case it's a bad idea to use tools because even if you end up …

Member Avatar for Tirian
0
119
Member Avatar for C Newbie

M represents the number of potential links in a node (the number of direct children). A binary tree is M=2, for example. A B+ tree stores data in the leaf nodes and only keys in internal nodes, so L in this case represents the number of data items each leaf …

Member Avatar for C Newbie
0
443
Member Avatar for mbw4359
Member Avatar for Th3one234

@jephthah [B]>um, search the filename string for a ".com" extension? yes?[/B] No. What kind of simpleton would do a naive extension search when the extension is largely ignored by the program loader? AV writers need to be smarter than that, because virus writers definitely are. [B]>it's pretty clear that you're …

Member Avatar for Th3one234
0
115
Member Avatar for newbiecoder

[B]>Can anyone tell me why such difference occurs?[/B] When printing a string (no format specifiers), the difference between puts and printf is that printf probably does more work for the same result. The reason is because printf needs to check for format specifiers while puts simply passes each character on …

Member Avatar for newbiecoder
0
672
Member Avatar for akira_shinizaki

>However, this one of my attempt, please give some suggestion. The usual pattern is a loop for the rows and two loops inside of it, one for the leading spaces and one for the triangle body: [code] for i = 0 to N for j = 0 to nspace print …

Member Avatar for kvprajapati
0
265
Member Avatar for smiller

Define "help", because I get the impression you want someone to do it for you.

Member Avatar for caut_baia
0
125
Member Avatar for viziroth

It's hard to help you without knowing more about this [ICODE]String[/ICODE] class. If it's even remotely reasonable, you should be able to do this: [code] for (int i = 0; i < s.length(); i++) s[i] = toupper(s[i]); [/code] [B]>char state[2] = {patientState};[/B] This is probably wrong. I suspect patientState is …

Member Avatar for caut_baia
0
208
Member Avatar for dillinger88

[B]>I'm having trouble determining why I'm getting this error.[/B] Obviously you're writing to an out of bounds index. Step through your code with a test set that reproduces the error and verify all of your indices.

Member Avatar for Salem
0
178
Member Avatar for LisaJane

>There's a hashtable class in the STL, use that. Not according to the standard, though a hashmap is a common extension.

Member Avatar for peter_budo
0
398
Member Avatar for xavier666

[B]>Define rational number as an ADT (abstract data structure)[/B] I fail to see how this is difficult. What kept you from completing the exercise? [B]>Write a suitable C code to sort a finite set of elements >where an element may appear a large number of times[/B] Well any general sorting …

Member Avatar for Narue
0
145
Member Avatar for alcondor

Using the shotgun approach, I see[1]. Good luck with it, I tend to ignore people who do that because they're pretty much always looking for freebies to cheat on homework. [1] Shotgun approach: post to as many forums as possible cross your fingers.

Member Avatar for Narue
0
166
Member Avatar for lllllIllIlllI

[B]>Nobody twisting your arm to click on the thread, is there?[/B] In theory, excessive posts could fill up the database and slow the site down enough to cost Dani more money in maintaining the status quo, and in turn she could start charging subscriptions. Every "I HAZ XXX POSTS D00D!!11" …

Member Avatar for bumsfeld
10
248
Member Avatar for invisal

[B]>If you find any grammatically mistake or you have better >way of explain the point, please do not hesitate to correct.[/B] Which amounts to rewriting your prose, I'm afraid. It's very clearly written by someone with grammar habits from another language, and those habits are hard to break with a …

Member Avatar for invisal
3
211
Member Avatar for hafeez_sheik

Have you tried anything, or done any research at all? You'll notice that this is a C++ help forum, not a get-your-work-done-for-you forum.

Member Avatar for pradip_
0
1K
Member Avatar for Sharon5

>Can you help me. No, because you didn't even ask a question. Believe it or not, most of us probably won't have your crappy textbook on our shelves and even if someone does, the chances of them divining your homework assignment are nil.

Member Avatar for BestJewSinceJC
0
490
Member Avatar for trantran

[B]>So can some of the knowledgeable person here tell me if it is ok, >and if so direct me to some part of the C++ standard that say so [/B] It's okay. Section 5.3.1, paragraph 2. [B]>void main(){[/B] You might also enjoy section 3.6.1, paragraph 2. The number of people …

Member Avatar for trantran
0
122
Member Avatar for Dex02

[B]>vectro, problem! >I am making a speel check program >Is this labary in Turbo/borland c++ difrent or what? >Uneable to open include file[/B] Good choice of problems to solve. A spell checker is clearly needed here. [B]>i have a problem with the libary #include <vector.h>[/B] <vector.h> is not a standard …

Member Avatar for Dex02
0
139
Member Avatar for praddy85

Look at the referenced lines. Does strsong[i] give you a char, or a pointer to char? The difference is significant, seeing as how you're trying to assign to a char variable.

Member Avatar for Narue
0
86
Member Avatar for vbx_wx

[B]>expected identifier before '(' token[/B] There's not an opening paren in the line of code you posted. Are any of those enumerators macros?

Member Avatar for Banfa
-1
89
Member Avatar for merse

[B]>so I want to define a casting function: >double(signum s) [/B] So do it. We're not talking about rocket science here: [code] double to_double(signum s); [/code] Or are you going to complain that double(s) is so vastly superior to to_double(s) that you absolutely [i]must[/i] have a user-defined cast that uses …

Member Avatar for Narue
0
3K
Member Avatar for buddy1

I can't claim to know Pep/8 assembly, but it looks like you're not indexing the array properly.

Member Avatar for mjmakl
0
2K
Member Avatar for liliafan

FYI, mn.balakumar, you missed the boat by almost six years. You're welcome to questions, but keep in mind that for each old thread you resurrect, a recent thread goes ignored by falling to the second page.

Member Avatar for Narue
1
317
Member Avatar for riahc3

[B]>I rather not use conio.h for cross compatibility[/B] Good idea. [B]>is there any way to make my own "conio.h" and just include it in my compilation[/B] Um, conio.h offers functionality that's non-portable by nature. No matter how you do it, you'll end up rewriting your replacement for every target to …

Member Avatar for jephthah
0
1K
Member Avatar for reshmasalian

[B]>watz de meanin of malloc.h n alloc.h in c-programmin(both are different)?[/B] Both are archaic and not recommended. malloc.h is the ancient header that got merged into stdlib.h. alloc.h is typically where one might find alloca. [B]>what is the difference between 1 pointer n 2 pointer in link list of stack?[/B] …

Member Avatar for sanji17
-4
195
Member Avatar for miskeen

[B]>I can't read uint16 directly from a file using sscanf[/B] You can't read [i]anything[/i] directly from a file using sscanf. [B]>Is that possible?[/B] I think you need to be more specific. Why do you think you can't read a uint16 value?

Member Avatar for miskeen
0
2K
Member Avatar for #define

[B]>i have a question that i want to reverse the queue in BigO(1) time and space[/B] That's not a question. A question would be "How do I reverse a queue in O(1) time and space?". Also note that your "question" lacks sufficient detail to be answered properly. [B]>thnx in advance …

Member Avatar for Narue
0
83
Member Avatar for LevyDee
Member Avatar for xofth

You need to shift all elements past the one to be deleted. Currently you only shift the first, which leaves you with something not quite what you wanted. Compare with this, which deletes the first occurrence of the selected value: [code] for(int i=0; i<length; i++) { if(arr[i] == key) { …

Member Avatar for Narue
0
141
Member Avatar for scrappy57

Unexpected garbage at the end of the string typically means you forgot to append '\0'. p.s. Start using code tags, please. I won't answer any but the most trivial questions that don't use code tags.

Member Avatar for Narue
0
72
Member Avatar for rickymak

[B]>I am guessing "FtoC" is a variable[/B] It's a function. [B]>I really am confused about why "to" is in there.[/B] That's part of the function name. It implies "Fahrenheit to Celsius". [B]>What does the paranthesis (float f) indicate?[/B] The function takes one argument of type float. [quote] A function is …

Member Avatar for Narue
0
108
Member Avatar for sharathk60

[B]>Yes you can use its source code to all os[/B] Assuming a compiler exists that targets the desired operating system. That's generally a safe assumption with C, but it does mean that you'll find systems where C isn't an option due to lack of developer tools.

Member Avatar for Ancient Dragon
0
140
Member Avatar for sadsack

>Do you think that DevC++ is a good compiler to use? Yes. >Is there a free one that is better? At your level, you wouldn't notice the differences that I would say make one compiler "better" than another. So Dev-C++ is fine unless you absolutely hate it for some reason.

Member Avatar for Ancient Dragon
0
215
Member Avatar for bradleykirby

>that's kind of crappy. Yes, it is. You should take advantage of the /x modifier. :icon_rolleyes:

Member Avatar for peter_budo
0
350

The End.