6,741 Posted Topics

Member Avatar for levk

>If I have two templates that are mutually dependent, is there a way to declare one without defining it? Yes, you can forward declare templates.

Member Avatar for Narue
0
135
Member Avatar for shortLived

>I can't get the compiler to accept the code So post the code. It's easier to figure out your problem when you give us more than just the bits and pieces that [b]you[/b] think are causing the problem.

Member Avatar for Narue
0
248
Member Avatar for DotNetUser

And the rest of the error is? Post your entire compiler output when you build the application.

Member Avatar for Dave Sinkula
0
1K
Member Avatar for levk

Okay, you have code that compiles, presumably you've also run it and seen that it does what you want. So why ask a question that you already know the answer to? Were we supposed to read your mind to discover what your real issue is?

Member Avatar for Narue
0
101
Member Avatar for ginpero

>I am a student taking up C programming Cool, sometimes it seems like new programmers are too afraid of C to learn it. >I do not know how to start with programming That's easy. Read books, do the exercises, ask questions on our C and C++ forum, and practice. >I …

Member Avatar for Dante Shamest
0
164
Member Avatar for zauber

>From what I understand, there is not supposed to be any support for >string-datatypes in the language itself No, it just requires you to implement strings yourself using arrays of char. There's no need for an explicit string type because arrays of char do the job admirably. >the syntax gives …

Member Avatar for zauber
0
116
Member Avatar for jhdobbins

>but im not sure how to do that It would be easier to build the data part of a node in your client code and pass it to the binary tree class. That would involve something like this: [code] struct data { char arriveCity[30]; char departCity[30]; int totalPassengers; int passengers; …

Member Avatar for jhdobbins
0
130
Member Avatar for indianscorpion2

We have discussed this issue before, and it was determined that the impact is not sufficient to warrant the work of splitting the two languages into separate forums and making the main forum list longer. It's also more likely that Dani would choose to make C++ the main forum with …

Member Avatar for jhdobbins
0
311
Member Avatar for JoBe

>if I remember correctly if the file to open isn't in the same directory as the file that contains the compiler Typically, the file will be relative to the current working directory, if you're in a command line environment. >This is an invalid expression. It looks fine to me. >Conditionals …

Member Avatar for Dave Sinkula
0
448
Member Avatar for umbrella

>pls give me the code plss No, no, and no. We don't do homework, and the more you ask, the more we will consider banning you. If you want to post an honest attempt to solve the problem, we'll be glad to help you with it, but we won't do …

Member Avatar for Dave Sinkula
0
442
Member Avatar for Kschikan

>Anyone know of a hack to make this work in IE also? Use a background image with a different color for the navigation bar. Repeat it down the page, then set up your divs so that they fit nicely onto the image. The effect is a perfect navigation bar that …

Member Avatar for Kschikan
0
349
Member Avatar for 3265002918

Structures are generally made global to begin with, that is, they are declared outside of all functions.

Member Avatar for 3265002918
0
105
Member Avatar for altheastronut

[url=http://www.eternallyconfuzzled.com/tuts/random.html]This[/url] would be a good page to read, along with [url=http://www.eternallyconfuzzled.com/articles/rand.html]this[/url] one. That should cover all of the bases to help you solve your problem. :)

Member Avatar for Narue
0
83
Member Avatar for Sef

>There is an error message which displays "warning: assignment to 'int' from 'double'". That's not an error, it's a warning. It's telling you that the fractional part of a floating-point value will be truncated when you assign it to an integer variable. You fix it by using doubles instead of …

Member Avatar for Narue
0
177
Member Avatar for winbatch

>Is there a (builtin) way to compare the contents of two stl maps? Have you tried the relational operators? Or did you just come running here before attempting anything so that you could waste time waiting for an answer?

Member Avatar for winbatch
0
499
Member Avatar for Kamex

From a purely "ignorant user" standpoint, Firefox has some annoying browsing aspects that I've encountered. One of the most irritating is when going back or forward, the browser sends you to the top of the page rather than the place you were last like IE does. IE is comfortable, but …

Member Avatar for Sparkplug188
0
445
Member Avatar for indianscorpion2
Member Avatar for alpha_foobar

The source base is the same, right? If you can keep an updated copy of the source at work then there's no point in using a cross-compiler.

Member Avatar for alpha_foobar
0
150
Member Avatar for BenPage

Just out of curiosity, where does it say that this forum provides help with proprietary libraries?

Member Avatar for Stoned_coder
0
105
Member Avatar for wu7jian

>it tells me the 'p' is not declared identifier No, it tells you that P is not a declared identifier. Notice the difference in case and remember that C++ is case sensitive.

Member Avatar for wu7jian
0
179
Member Avatar for Acidburn

>just wondering if theres any guidance you could offer as to learning MFC in c++ Don't? ;) >I get around 225 linker errors It sounds like you aren't linking with the correct libraries. Did you make any changes to your linker to allow building of MFC applications?

Member Avatar for Narue
0
99
Member Avatar for Gillzor
Member Avatar for Gillzor
0
342
Member Avatar for angel22

You can avoid nested if statements with the else if clause: [code] if ( sentence[i] == '0' ) cout<<"zero"; else if ( sentence[i] == '1' ) cout<<"one"; else if ( sentence[i] == '2' ) cout<<"two"; else if ( sentence[i] == '3' ) cout<<"three"; else if ( sentence[i] == '4' ) …

Member Avatar for winbatch
0
232
Member Avatar for JoBe

>are all three correct possibilities to obtain the functions adres? You can only do two things with a function: call it, and take its address. If you're not calling it, then the compiler assumes you're taking its address. >I tried out the example you showed about pointers to functions and …

Member Avatar for Narue
0
302
Member Avatar for mozira

>Here is the code if you can do it plz send me the coding You want to give us a simple console mode program and have us write a complicated GUI interface for it because you're too lazy to do it yourself? Are you having difficulty because nobody is stupid …

Member Avatar for Narue
0
498
Member Avatar for wu7jian

A struct is just like a class in that it has to be terminated with a semicolon. And you need to declare an instance of the struct [b]after[/b] it is declared, not before: [code] #include<iostream> using namespace std; class linkedlist { private: struct llink { int elem; llink* nextelem; }; …

Member Avatar for wu7jian
0
150
Member Avatar for MadDogSh

>all of a sudden I found I've earned 11 reputation points... That's a good thing. It means you were helpful and the person you helped was kind enough to give you good rep. >how those points are summed up Each user has a reputation power based on their own reputation. …

Member Avatar for MadDogSh
0
450
Member Avatar for Jon182

>I was just wondering what the term wildcard means in C++ It means nothing in C++. >why some people initalize int variables to -1 rather than 0 does this have any advantages? Not really, but it very much depends on the rest of the code. Can you give an example?

Member Avatar for jhdobbins
0
93
Member Avatar for zeek

>but trying to code it, it seems so complicated That's because it [b]is[/b] complicated. Sorry.

Member Avatar for vegaseat
0
284
Member Avatar for desidude

>temp.size[i][j] size is an int, not an two dimensional array. Fix this, rinse, and repeat until your errors go away. Though just getting a clean compile doesn't mean it will work like you want it to. ;)

Member Avatar for desidude
0
161
Member Avatar for fishman

>How would it change the code? First, you would start a new thread instead of resurrecting a thread that's over a year old. Then you would use a std::vector object because arrays are error prone and difficult to use correctly. Thread locked to avoid further bumping.

Member Avatar for Narue
0
10K
Member Avatar for angel22

The test for an illegal move relies on dice1 and dice2, yet, when there's an illegal move, you never reset those values, so the test will always fail.

Member Avatar for Narue
0
85
Member Avatar for crazyfans86

Do you need to actually draw it, or just plot the coordinates so that they can be imported into something like Excel?

Member Avatar for Narue
0
122
Member Avatar for lortfan

>which can help you out in learning the language C/C++ First, there is no language called C/C++. There's C, and there's C++, but no C/C++. Life is much easier when you don't confuse the two. Second, I wouldn't recommend any site for learning either C or C++ that has void …

Member Avatar for nemesisrobot
0
170
Member Avatar for Mahen
Member Avatar for Mahen
0
101
Member Avatar for wu7jian

>i don't understand the following clause. It initializes s to a null pointer. The cast is not needed, which suggests that the author really doesn't know what he's doing: [code] LargeStruct *s = 0; // Works just fine and is easier to read [/code] >why not just: LargeStruct * s? …

Member Avatar for wu7jian
0
168
Member Avatar for freemind

These two member functions are not defined: [code] virtual void add(list<TelB*>&); virtual void del(list<TelB*>&); [/code] You need to either provide them with a body, or make them pure.

Member Avatar for freemind
0
246
Member Avatar for joeh157

>And a function that sorts from highest to lowest? That's a very broad question. You can look [url=http://www.eternallyconfuzzled.com/tuts/sorting.html]here[/url] for an idea of where you want to go with it. >How would I write a function that takes the highest number in an array of 10 and out put it? Conveniently …

Member Avatar for Narue
0
78
Member Avatar for zauber

>it seems quite tricky getting hold of programming tips and tutorials which apply to c and not c++ Most of my tutorials favor C over C++ so that they can be more widely used and are easier to format for XHTML. You can also find active newsgroups (like comp.lang.c) on …

Member Avatar for Narue
0
152
Member Avatar for server_crash

>How important is it to learn and understand sorting algorithms and routines? It's very important. Even if you always use libraries (which is somewhat silly since libraries are designed to be generic and you may need something specific), sorting algorithms cover a huge number of techniques and concepts for designing, …

Member Avatar for Narue
0
268
Member Avatar for zeek

Just clear the stream of extra characters. You can use this function: [code] void discard ( FILE *in ) { int c; while ( ( c = fgetc ( in ) ) != EOF && c != '\n' ) ; } [/code]

Member Avatar for Narue
0
452
Member Avatar for steelers_fan

>because of their ivory tower attitude towards software development As I like to say: Good developers look for solutions, good CS graduates look for problems. ;)

Member Avatar for freesoft_2000
0
227
Member Avatar for kartik911

>this is not the biggest dificulty in the world Judging from your code, apparently it is. >Hope it helps No, as a matter of fact, it doesn't. Your code is non-portable, and very poorly written. If giving the OP a freebie doesn't get him expelled, you'll have taught him bad …

Member Avatar for Narue
0
276
Member Avatar for trashed

>i need my script to use all files in a directory You can search a directory with opendir and readdir and closedir. Check your man pages for details. >but now can i do this You need to build the path string manually: [code] char user_path[] = "user_path"; char filename[] = …

Member Avatar for Narue
0
128
Member Avatar for ^Simes^

Well, in the absence of a proper library, you can write a specialized conversion yourself without any trouble: [code] void wtos ( WORD w, PTCHAR s ) { s[2] = '\0'; s[1] = w % 10 + '0'; s[0] = w / 10 % 10 + '0'; } [/code]

Member Avatar for Narue
0
111
Member Avatar for angel22

An array is just about the simplest and most useful thing you can think of. Imagine a line of boxes numbered 0 to N, where N is some arbitrary number. To put something in the fifth box, you walk over to the one with the number 4 (because they start …

Member Avatar for angel22
0
394
Member Avatar for jhdobbins

>#include <cstring> This doesn't give you the string class, it gives you the C-style string functions. Why not reverse the string in place? [code] int i = 0; int j = input.size() - 1; while ( i < j ) std::swap ( input[i++], input[j--] ); [/code]

Member Avatar for jhdobbins
0
138
Member Avatar for winbatch
Member Avatar for Drowzee

Didn't you already ask this question? Weren't you already directed to a newsgroup that is more likely to care about your question than we are?

Member Avatar for Drowzee
0
129
Member Avatar for reezin14

One generally purchases books from a thing called "The Bookstore". There are even "bookstore"s online such as [url]www.amazon.com[/url].

Member Avatar for shanenin
0
252

The End.