6,741 Posted Topics

Member Avatar for peterb92

I think your post is in the wrong forum. You mentioned Visual Basic, Javascript, and HTML, yet your post is in the C/C++ forum.

Member Avatar for Narue
0
111
Member Avatar for mel2005

>the following three questions You only have two questions. >Any flight can be brought to the front of the queue ready for deleting Since your queue is implemented with a linked list, you can easily splice out an item and replace it elsewhere: [code] void moveToFront ( queue& q, const …

Member Avatar for Fasola
0
361
Member Avatar for mel2005

>how do i delete the code i put on here You ask a mod to remove selected parts of your post, or the entire post if you feel the need.

Member Avatar for Narue
0
132
Member Avatar for nizar4445
Member Avatar for missy

Okay, and you were expecting someone here to do it for you? From what I can tell by your code, there's been minor (if any) effort on your part to solve the problem.

Member Avatar for Narue
0
164
Member Avatar for cblue

>but how do you accomdate for the letters a-f if the digits are greater than 9? Use a string: [code] static const string hex ( "0123456789ABCDEF" ); [/code] This is a simple problem once you figure it out. The function shouldn't need to be more than 4 or 5 logical …

Member Avatar for Narue
0
159
Member Avatar for bobr_1013

You may like this trick. :) If you treat your records as strings then you can easily place them in a single array and work with them using standard string operations. The cost is two extra characters per element. [code] #include <stdio.h> #include <string.h> #define MAX_ELEMENTS 2 char table[MAX_ELEMENTS][20]; void …

Member Avatar for bobr_1013
0
159
Member Avatar for Dark_Omen
Member Avatar for Dark_Omen
0
195
Member Avatar for mdbrock7

The traditional (if inefficient) algorithm is: [code] # Pseudocode gcd ( m, n ) begin while m != n do if m > n m := m - n else n := n - m loop return m end [/code]

Member Avatar for Narue
0
280
Member Avatar for dallin

C++ doesn't have native support for working with monetary values. You need to either find a library that does what you want, or roll your own: [code] #include <iomanip> #include <iostream> #include <sstream> #include <string> using namespace std; string currency ( double value ) { ostringstream sout; sout<< fixed << …

Member Avatar for dallin
0
171
Member Avatar for Acidburn

Just print array2 for each iteration of the loop. When the user chooses a letter, do a search in array, and if you find it, replace the corresponding index in array2 with the letter.

Member Avatar for Narue
0
204
Member Avatar for JoBe

>out<< n; >string s = out.str(); In this case (since you're taking the rightmost digits) arithmetic operations may be easier: [code] if ( n >= 10 ) { // Make sure there are two digits int a = n % 10; int b = ( n / 10 ) % …

Member Avatar for Narue
0
604
Member Avatar for bizpro

IIRC you need ten posts before you can create a unique signature. Presently you only have two.

Member Avatar for bizpro
0
166
Member Avatar for xsxixtxhx

>Node *newPtr = new Node ; You're trying to use a constructor with no arguments, yet your Node is declared as: [code] struct Node { Item item; Node *next; Node( Item itm, Node * nxt ) : item(itm), next(nxt) { } }; [/code] Notice how the only constructor declared takes …

Member Avatar for Narue
0
164
Member Avatar for ! !
Member Avatar for Narue
0
91
Member Avatar for letmec
Member Avatar for some one

>if( s=="pass") If we could do this, why would we need strcmp? >gets(s); gets is evil. There's no way to make it safe, so you would do well to forget it even exists. Let's get you started off in the right direction. Unless you're a stubborn C programmer who can't …

Member Avatar for Fasola
0
262
Member Avatar for belama

How much do you want to bet that this will eventually be made due to popular demand for Google Gulp?

Member Avatar for belama
0
128
Member Avatar for rborob

>while (!file.eof()) While this can be made to work, it requires unnecessary redundancy or an uncommon looping idiom. Anything else is incorrect because eof() only returns true [b]after[/b] an attempt to read from the stream has failed, so the loop will iterate twice for the last record in the file. …

Member Avatar for Narue
0
106
Member Avatar for shock1

>I have no idea what to do here This is where you read a book. If we told you how to solve the problem, or gave you the code to do it, then you would learn nothing.

Member Avatar for Narue
0
109
Member Avatar for shock1

>void printAttitude(int){ When you give a function a body, you [b]must[/b] name each of the parameters: [code] void printAttitude ( int [B]name[/B] ) { [/code] >if (int == 1){ int is a type, 1 is a value. You can't compare types with values. Once you name the function parameter, you …

Member Avatar for Narue
0
390
Member Avatar for shock1

>>which has two int parameters and [B]returns nothing[/B] >if a is larger than b [B]return [/B] a, else [B]return [/B] b Um, no. If a is larger than b you print a, otherwise print b. >p.s i get mixed up with the < and > operators cant remember which one …

Member Avatar for Narue
0
197
Member Avatar for The_Diceman

>Does this ring any bells with you? Of course. It's a common homework exercise and a common part of any business file processing. This is clearly homework, and you haven't shown an attempt, so the help you get will be minimal.

Member Avatar for The_Diceman
0
190
Member Avatar for Hjcooke

Please use [url=http://www.daniweb.com/techtalkforums/misc.php?do=bbcode#code]code tags[/url] when posting any length of code. However, it becomes more important when you post a lot of code. I've added tags to both of your posts, but for further posts it's up to you.

Member Avatar for shakaal
0
263
Member Avatar for Jankos

>well it needs to be made in a combination of C and c++ really Why? Unless you're familiar with C, the only possible result of trying to mix the two is a lot of compilation and run-time errors. >void main() This is neither C nor C++. main always returns int.

Member Avatar for Narue
0
103
Member Avatar for Lorita

>and pass values using set and get functions If possible, set and get member functions should be avoided. The only advantage is that data members can be accessed through a controlled interface, but a well designed class will hide its internals properly, thus making the need for get and set …

Member Avatar for Acidburn
0
176
Member Avatar for Acidburn

>if (Date == someDate) Date is a type, someDate is an object of that type. A comparison between them is nonsensical. I assume you want to test the parameter to see if it's the same object as the method is being called on? [code] bool Date::testEqual ( Date& someDate ) …

Member Avatar for Acidburn
0
170
Member Avatar for mel2005
Member Avatar for fiberoptik
Member Avatar for Layla_2401

>But I've noticed that after building the project I don't have an .exe in the workspace. Look in the Debug folder.

Member Avatar for Layla_2401
1
220
Member Avatar for hasan2003

Your teacher is confusing arrays with linked lists. An array is always a contiguous sequence of cells, so there's no need for one cell to "point" to the next. Because the nodes of a linked list are not contiguous in memory, a pointer to the next node is critical.

Member Avatar for Acidburn
0
138
Member Avatar for Asif_NSU
Member Avatar for Narue
0
144
Member Avatar for JoBe

>1) Do you understand what the idea is for this exercise when reading the task? Yes, they want you to take three integers and pack them into one integer by partitioning a certain number of bits for a value that will never exceed those bits. >2) If so, could you …

Member Avatar for Narue
0
403
Member Avatar for the_shark

The most obvious problem is that you're testing for 0 or 1 instead of '0' or '1'. Remember the the contents of your string are characters, not integers. You're also going about the problem in a complicated way, but because you don't want help with that part, I won't show …

Member Avatar for the_shark
0
172
Member Avatar for mb1

find returns an index, not a string. For example, if the string is "atest" and you search for "test", find would return 1. Then you could do this: [code] int index = s.find ( "test" ); if ( index != string::npos ) cout<< s.substr ( index ) <<endl; [/code] And …

Member Avatar for mb1
0
182
Member Avatar for kohkohkoh

[url=http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1048384015&id=1043284392]This[/url] would be a good start.

Member Avatar for Narue
0
40
Member Avatar for tenoran

[url=http://docs.sun.com/source/806-3568/ncg_goldberg.html]Clickie Here[/url]

Member Avatar for Narue
0
123
Member Avatar for bigMon21

[code] int a[10] = {0,1,2,3,4,5,6,7,8,9}; int *p = a; int i; for ( i = 0; i < 10; i++ ) printf ( "%d\n", *p++ ); [/code]

Member Avatar for Narue
0
82
Member Avatar for kaoss1103

Unless your mentor is a total guru (and they're few and far between), you would be better off hanging around an open forum such as this one. That way people who help you can be corrected if they make mistakes, and you won't be pushed unknowingly into bad habits.

Member Avatar for Acidburn
0
157
Member Avatar for crestaldin
Member Avatar for alc6379
0
142
Member Avatar for tenoran

A memory leak is simply allocating memory and failing to release it when you're done. Technically, the following illustrates a memory leak: [code] #include <iostream> using namespace std; int main() { int *p = new int; *p = 10; cout<< *p << endl; } [/code] In practice, the operating system …

Member Avatar for Acidburn
0
90
Member Avatar for JoBe

>when do you know it's better to use RECURSION Most of the time, binary search trees are better written with recursive algorithms. Sure, it may be a fun exercise to do them iteratively, but anything but a simple binary search tree will be dreadfully complex without recursion. I haven't met …

Member Avatar for JoBe
0
185
Member Avatar for Maple_Tiger

The difference is subtle. When you declare something, you're simply stating its name and type. When you define something, you're actually creating an object in memory. A declaration doesn't result in memory being allocated, but a definition does. The reason they often look the same is that a definition is …

Member Avatar for Maple_Tiger
0
190
Member Avatar for JoBe

>don't know the name of ',' in English Radix >I don't know how I can do that Floating-point is a bitch to work with. You would be better off converting to a string as vegaseat suggested: [code] #include <iostream> #include <sstream> #include <string> using namespace std; int precision (double val) …

Member Avatar for JoBe
0
299
Member Avatar for Acidburn

>Everything works if i take away the job class So the problem is with job.h and you can focus your debugging there. For example: [code] void getjobnumber() [/code] Don't you think that should be: [code] void job::getjobnumber() [/code] It's also a good idea to tell your compiler to produce preprocessed …

Member Avatar for Acidburn
0
137
Member Avatar for galmca

>*p=(tree*)malloc(sizeof(tree)); If you really are using C then there's no good reason to cast malloc. It hides the fact that you forgot to include stdlib.h. >void main() main doesn't return void, it never has. It returns int, and nothing else. >fflush(stdin); fflush is only defined for output streams, using it …

Member Avatar for Fasola
0
406
Member Avatar for xplod420_2

>can somebody help me finish this please. You've barely done anything. Work out what calculations you want to do on paper before trying the code. That way you have a good idea of what needs to be done. As it is, I get the impression that you have no idea …

Member Avatar for xplod420_2
0
144
Member Avatar for computerages

How do you define the measure of complexity? If the measure is number of features the Ada, PL/I, or C++ would be near the top of the list. What about the ability to describe the same solution in a huge number of ways? Well, at that point my vote might …

Member Avatar for vegaseat
0
301
Member Avatar for ibmackin

>how the hell do you do this?! Start by learning from the previous assignment, as this assignment suggests. We don't do homework for you, show an attempt or you'll encounter nothing but stoney silence.

Member Avatar for 1o0oBhP
0
163
Member Avatar for Raza
Re: Boot

[url=http://www.linuxgazette.com/issue77/krishnakumar.html]Start here[/url]

Member Avatar for Raza
0
224

The End.