6,741 Posted Topics

Member Avatar for sisi

>i have to give the programme back to my teacher in few mins Too bad, so sad. We're not responsible for your laziness.

Member Avatar for Narue
0
125
Member Avatar for kux

>Looking at the error i get with g++ would mean that there >is no open method that takes a wchar_t* as parameter g++ is correct. The C++ standard doesn't define an open member function that takes const wchar_t* as a filename type. >but then, why the heck does it compile …

Member Avatar for Narue
0
219
Member Avatar for Sh13

In other words, you have nothing. Give it a try first, then we'll be more inclined to help you.

Member Avatar for Sh13
0
78
Member Avatar for technogeek_42

>what is the opposite for the virus? What is a virus? It's basically a program that propagates itself, "infecting" the target computer. The opposite of a virus would be any program that doesn't multiply on its own at all. You might also define a virus as a self-multiplying program that …

Member Avatar for Jx_Man
0
268
Member Avatar for daviddoria

>Any reason why this wouldn't fix it? I add warning 4996 to my "I don't give a crap" list in the project settings[1]. You can also disable it directly in the code using a pragma: [code=cplusplus] #pragma warning(disable:4996) [/code] [1] Assuming you're using Visual Studio, of course. ;)

Member Avatar for vmanes
0
106
Member Avatar for g_loughnan

Let's start with two simple rules: You can't nest function definitions, and you can't have two identifiers in the same scope with the same name. So move the definition of memcof outside of main and stop reusing names like data, n, m, xms, and d. Finally, memcof steps on the …

Member Avatar for g_loughnan
0
97
Member Avatar for thedonshi

>The List class contains all the linked list information This sounds like ListNode is a nested class. Most likely the problem is you're not properly qualifying the type: [code=cplusplus] List::ListNode cur = new List::ListNode; cur = head; cur = cur->next; [/code]

Member Avatar for Narue
0
132
Member Avatar for sjgriffiths

>this field may/may not be empty strtok ignores empty fields, so if that field is empty, you're actually processing a null pointer because there are fewer fields than you're expecting. If you want to get an empty string for the empty field, don't use strtok.

Member Avatar for Narue
0
172
Member Avatar for curt1203

>i have attached the directions for our assignment and what the output is supposed to look like No, you haven't. But that's okay because I'd tell you that very few of us are willing to open attachments and that you'd have better luck if you just copy/pasted the details in …

Member Avatar for sinkingships7
0
139
Member Avatar for Lensva

>please keep it as simple as possible [code=cplusplus] client a, b, c; a.setStats(); b.setStats(); c.setStats(); [/code] Of course, this is assuming your client class wasn't broken, which it is. But since people tend to rail on me for answering questions that weren't asked, I won't go into detail.

Member Avatar for VernonDozier
0
115
Member Avatar for mreply

>can u tell me y linker gives error when we try to define a variable >in a header file and include this in more than one source file? C allows you to declare a variable any number of times, but you can only define it once. If you place a …

Member Avatar for Salem
0
276
Member Avatar for modaslam

>what are these constants Why don't you ask the person who created the formula? >why m-1, yy-1 etc.. I imagine because m and yy are 1 based, and the formula works better with values that are 0 based.

Member Avatar for modaslam
0
149
Member Avatar for cedtech23

>char fname[100][50]; That should be 51 if you're allowing 50 content characters. You need to make room for the null character at the end.

Member Avatar for Ancient Dragon
0
173
Member Avatar for resduq

>You cannot print the whole array in one action. Sure you can: [code=cplusplus] #include <algorithm> #include <cstddef> #include <iostream> #include <iterator> template <typename T, std::size_t N> T *end ( T (&array)[N] ) { return array + N; } int main() { int a[] = {1,2,3,4,5,6,7,8,9,0}; copy ( a, end ( …

Member Avatar for resduq
0
281
Member Avatar for Google Spider

>I wonder what are they do in there? Much like the real Area 51, ours is rather anti-climactic. ;)

Member Avatar for sneekula
0
218
Member Avatar for djinn1971

You don't need any math procedure (assuming you mean a library function) as this task involves no more than is simple arithmetic: [code=vbnet] Do While pennies >= 5 If pennies >= 100 Then dollars += 1 pennies -= 100 Else If pennies >= 25 Then quarters += 1 pennies -= …

Member Avatar for djinn1971
0
220
Member Avatar for kinger29

>I am having trouble understanding what a successor is. A successor is the node with the next highest value. [code] 6 3 8 2 5 7 9 4 [/code] In this tree, the successor of each node is the next node that would be given in an inorder traversal. For …

Member Avatar for Narue
0
86
Member Avatar for Crushyerbones

>Compile and run it, then do it again with the line //in(buffer,b); uncommented. It breaks inside if the in function on this line: [code=c] current[x]=b[i+x]; [/code] And it does this because strlen(a)-strlen(b) in your outer loop condition results in a negative number, yet you increment i from 0.

Member Avatar for Crushyerbones
0
122
Member Avatar for bhoot_jb

>so what say now?? You got lucky. Just because it doesn't crash when you run it this time doesn't mean it won't crash next time, or when you're demoing your program for a client. Undefined behavior is like that.

Member Avatar for WaltP
0
105
Member Avatar for jerryseinfeld

>Please don't blame that code on me! :) I didn't write it. Heheh, gotta love being attributed for bad code. ;) >Second question is how can I write hexadecimal numbers? can c recognize hexe?? C can read and write hexadecimal. Since it's a formatted value, you need to use the …

Member Avatar for yupi
0
429
Member Avatar for jitendersharma

I'm moving this from the necrothread you bumped from 2006 to its own thread so that you can be properly hazed by the regulars.

Member Avatar for Aia
0
74
Member Avatar for Jennifer84

IIRC, there's a SelectionChangeCommitted event in the ComboBox class. Subscribe to that event and run your code inside the event handler.

Member Avatar for Jennifer84
0
143
Member Avatar for darklich13

Well, to begin with, you're reading a leading character from the file. If that leading character is actually part of one of the numbers you want to read, you've corrupted your input stream by changing the starting offsets of each read. Further, the variable you're using to read numbers is …

Member Avatar for darklich13
0
168
Member Avatar for daviddoria

>It seems very distracting to have a thousand lines of code all in the same file Modern IDEs make it very simple to deal with this, provided the thousand lines are all relevant to the file. >Is there a good way to kind of group functions together into separate >files …

Member Avatar for Narue
0
99
Member Avatar for dolphin.rise

>What is the relationship between inheritance and composition Inheritance is a special case of composition. >why the two can be used in place of other They solve the same problem and they're equally functional. If you're willing to suffer notational and structural inconveniences, inheritance can always be used in place …

Member Avatar for Ancient Dragon
0
128
Member Avatar for hobbsalex

Hmm, let me see if I understand what you're doing. Is it taking a single linked list and splitting it into an array of linked lists based on a certain criteria? [code=c] #include <stdio.h> #include <stdlib.h> struct node { int data; struct node *next; }; struct node *push_front ( struct …

Member Avatar for hobbsalex
0
3K
Member Avatar for dolphin.rise

1) The following compiles as C++, but not in C: [code=cplusplus] #include <stdio.h> int main ( void ) { int a = 0; int b = 0; (a, b) = 10; return 0; } [/code] 2) The short answer is that an enum constant in C is an integer type, …

Member Avatar for Narue
0
128
Member Avatar for dolphin.rise

>Is there any specific advantage of using int main() over void main() There is indeed. int main() is always correct, void main() is not.

Member Avatar for mitrmkar
0
273
Member Avatar for naiad08

As darkagn has already said, we're not a homework service. We're a resource for education. Much like your teacher isn't going to do your homework for you, the same goes for us because that defeats the purpose of this forum. However, I [i]will[/i] link you to a [url=http://eternallyconfuzzled.com/tuts/algorithms/jsw_tut_sorting.aspx]sorting tutorial[/url] with …

Member Avatar for jamshid
0
167
Member Avatar for modaslam

You're over-engineering the solution. It's really nothing more than this: [code] print ' ' print n '*' for i = 0 to n do print n + 2 '*' loop print ' ' print n '*' [/code]

Member Avatar for Narue
0
116
Member Avatar for ahjiefreak

>fscanf(filename, "%d", t[i]); >fscanf(filename, "%c", dump); Don't forget that scanf expects a pointer. If your variable isn't already a pointer, you need to prefix it with the address-of operator: [code=c] fscanf(filename, "%d", &t[i]); fscanf(filename, "%c", &dump); [/code]

Member Avatar for Narue
0
130
Member Avatar for lostandconfuzed

It's generally considered rude to post your code and say "please help". Such a request is far too vague. Perhaps you could ask a specific question or describe exactly what you're having trouble with.

Member Avatar for knewc
0
142
Member Avatar for Jennifer84

IIRC, the event handlers will give you an EventArgs object that has this information.

Member Avatar for Jennifer84
0
102
Member Avatar for SHIFA JINDAL

>How many types of sorting are there in c? Hundreds with names, thousands more without names. >give code for all of them Haha, no. Do your own work.

Member Avatar for majestic0110
0
43
Member Avatar for Lensva

I'm not sure I understand what you want. I'll guess, probably be wrong, and then ask you to describe the problem in a different way. So here's my guess: [code=cplusplus] #include <iostream> #include <stdexcept> class Foo { int _a; int _b; int _c; public: Foo ( int a, int b, …

Member Avatar for Lensva
0
98
Member Avatar for Traicey

Simple solution: Make the center line a special case outside of the loops and change the condition of the loops to be < 10 rather than <= 10: [code=cplusplus] #include <iostream> #include <iomanip> using namespace std; void main() { int space = 2; int counter = 19; int count = …

Member Avatar for Narue
0
2K
Member Avatar for 666kennedy

It seems to work fine for me. Can you be more specific about how it's not working properly? Perhaps also tell us what the type of your pattern variable is?

Member Avatar for Narue
0
138
Member Avatar for Jboy05

>Do you see anything wrong with this Yes, I do. Clearly you haven't compiled or run this code, otherwise you would see something wrong as well. I suggest you do that.

Member Avatar for Jboy05
0
143
Member Avatar for TylerTCF
Member Avatar for Jennifer84

Off the top of my head, I don't think there's a way to do that without some kind of presentation trick that hides the changes in progress until they're finished.

Member Avatar for Jennifer84
0
96
Member Avatar for majestic0110

>I am contemplating moving from c# to VB Ideally you should learn them both. The actual languages aren't overly complicated, it's the .NET framework that has a huge learning curve. So if you already know the framework, you should have the more common .NET languages in your repertoire. >if I …

Member Avatar for majestic0110
0
121
Member Avatar for alkeshtech

Call srand at the beginning of your program, not each time you call rand. You keep reseeding the random number generator, and because your program is running fast enough, the seed is always the same. This will result in the same "random" number every time.

Member Avatar for alkeshtech
0
297
Member Avatar for Jennifer84

I'm guessing that you're looking for "walker" (or rather, "walke" going by your code) and highlighting the entire string regardless of whether the search string is a substring or the whole line.

Member Avatar for Narue
0
88
Member Avatar for sjgriffiths

My first question is why are you using an array of 1? There's no benefit to using an array if it only has one element. >How do i assign my integer value to the above variable? Presumably you're asking how do you convert an integer into a string. Here's an …

Member Avatar for Narue
0
88
Member Avatar for _::suhanna::_

You're missing a comma between the address and handphone arguments in your call.

Member Avatar for _::suhanna::_
0
104
Member Avatar for Agni
Member Avatar for snorri

>Can anyone here shed some light on it? Gladly. The problem is that you're expecting a well defined order of evaluation where none exists. The language standard says that between sequence points, the compiler can evaluate the expression in any way it likes as long as the result is correct …

Member Avatar for snorri
0
96
Member Avatar for noktasizvirgul

I can think of two simple solutions off the top of my head: 1) Allocate an array of N, where N is the number of nodes in the tree. Then traverse the tree and save the level of each node in the array as you go. Sort the array and …

Member Avatar for Narue
0
178
Member Avatar for lostandconfuzed

You're mixing up two different solutions for calculating a factorial. Just remove all of the manual stuff and use the function: [code=cplusplus] #include<iostream> using namespace std; int factorial(int); int main() { int x; cout << "Enter a number to see factorials for: "; cin >> x; cout << "\n"; for …

Member Avatar for Narue
0
93
Member Avatar for pelino

Barring the bad idea of using goto where a loop construct is better suited, what have you tried? Generally we expect you to post code to prove that you've made an honest attempt before we'll help.

Member Avatar for Narue
0
44

The End.