15,300 Posted Topics

Member Avatar for Niner710

Because you declared the structure within the body of the class you have to use the class scop operator when referencing the structure. Its not necessary to use the struct keyword. [icode]Blah::Values *getValues();[/icode]

Member Avatar for ArkM
0
129
Member Avatar for joed13k1941

something like [code] if( num < 0 || num > 100) { cout << <message to user> return 1; } [/code] But normally instead of just exiting the program it should loop back and prompt for input again.

Member Avatar for joed13k1941
0
233
Member Avatar for RouseA

if you are using gcc for *nix or ms-windows, then there is no way to do it because those operating systems will not allow it.

Member Avatar for Salem
0
154
Member Avatar for Traicey

If its a text file then you have no other choice but to rewrite the entire file. Open original file for read, open another temp file for write. In a loop read a line from input file and if its not the line you want to delete just rewrite it …

Member Avatar for unbeatable0
0
119
Member Avatar for sunveer

>>i don't know even how to start writing the code Start here [code] #include <iostream> using std::cout; using std::cin; int main() { // put your code here } [/code] First, you need to declare the matrix. How many dimensions does it have (2, 3, 4, 5, ...) What dimensions does …

Member Avatar for n1337
0
119
Member Avatar for nehansh

The only legal way to get them is by spending your $$$ for the Pro edition. The standard edition might support them too, I don't know about that.

Member Avatar for jencas
0
94
Member Avatar for jeevsmyd

There have been lots of threads here about how to clear the screen. [URL="http://www.daniweb.com/code/snippet232.html"]Like this one[/URL]

Member Avatar for Ancient Dragon
0
124
Member Avatar for AutoC

>>range 0000h to ffffh instead of [0,1) 0xffff is -1 not +1 in signed short integer, but unsigned short integer its a pretty huge number -- for exact value see your limits.h header file. With 16-bit compilers a short and an int may be the same size, but on 32-bit …

Member Avatar for Ancient Dragon
0
69
Member Avatar for patricksquare

>>>can you help? No -- I have no clue what that program is supposed to do. Don't expect me to read your other threads -- a thread should stand on its own.

Member Avatar for WaltP
0
112
Member Avatar for slayman89

The problem is line 9: remove the \ (line continuation character) at the end of the line.

Member Avatar for slayman89
0
100
Member Avatar for Gary_nel

Look at [URL="http://msdn.microsoft.com/en-us/library/aa448196.aspx"]MSDN[/URL] and it will tell you what header file and library you need for that function. All you had to do was search google for that function and the link appeared as the very first link. Took me all of about 10 seconds to find it.

Member Avatar for Ancient Dragon
0
146
Member Avatar for chococrack

[b]this[/b] is a pointer, [b]*this[/b] dereferences the pointer. So if you want to pass a pointer just don't use the asterisk. [icode] myFunction(this, &copyClass);[/icode] That doesn't mean it will solve your problem, but that's how to pass pointers. That looks like a recursive function call, I doubt you even need …

Member Avatar for Narue
0
280
Member Avatar for StephanJos

you need to use std::stringstream class. It is very similar to fstream but ccreates the result in memory instead of in a disk file. [code] #include <sstream> #include <string> using namespace std; int main() { int a = 4, b = 5, c = 6; string d; stringstream str; str …

Member Avatar for Ancient Dragon
0
190
Member Avatar for shiniboy

why is that function not returning the mean ? You don't need that last parametewr [code] double meanOf3(double value1, double value2, double value3) { return (value1 + value2 + value3)/3; } int main() { <snip> double mean = meanOf3(value1, value2, value3); } [/code]

Member Avatar for Sky Diploma
0
138
Member Avatar for GrimJack

you are making a mountain out of a molehill. The President is allowed to use military force when requested by state governors or when the state is unable or unwilling to to protect civil rights and property. I believe LBJ used that authority in the 1960s to assist school desegregation.

Member Avatar for GrimJack
1
152
Member Avatar for unk45

Since you have the coice of entering either last name, or first and last name, you will probably have to ask for which they want to enter then create an if condition Example: [code] ... int type; char firstname[20] = {0}; char lastname[20] = {0}; cout << "Enter 1) Last …

Member Avatar for stilllearning
0
232
Member Avatar for CPPRULZ

line 8 belongs up between lines 2 and 3. The using statement should appear immediately following all includes and before any functions. line 7: you can't declare arrays without the dimensions. line 12: you have to pass an array. You call it like this: [code] int arr[10]; // an array …

Member Avatar for vidit_X
0
350
Member Avatar for JackDurden

Its done something like this: Note: not compiled or tested. [code] node* temp=start_ptr; node* prev = NULL; while( temp ) { if( temp->item == item) { // delete this node if( prev == NULL) { // we are at the head of the linked list, for remove the head start_ptr …

Member Avatar for JackDurden
0
86
Member Avatar for luisvega

sscanf() is a C function, not c++, and knows nothing about c++ containers like std::string, you have to pass it a character array. [icode]sscanf(xx.c_str(), "%c%c %c%c", &fromX, &fromY, &toX, &toY);[/icode]

Member Avatar for Ancient Dragon
0
129
Member Avatar for shiniboy
Member Avatar for jammy's

what's your question about queues ? Don't just post code and expect us to guess what you want.

Member Avatar for Ancient Dragon
0
87
Member Avatar for GrimJack

I hope Sarah does well tonight -- I don't like seeing girls cry. Aside: As you all know (or should know) I'm from St Louis area where the debate is going to be held in an hour or so. The city is filled with cops from all over the state …

Member Avatar for sneekula
0
254
Member Avatar for needhelp83

Are you sure you have the prequisits for that course? It sounds pretty advanced for a beginner.

Member Avatar for needhelp83
0
144
Member Avatar for Ancient Dragon

I'm a newbe at this so started the walkthrough. I'm really confused about one statement [url]http://msdn.microsoft.com/en-us/library/k4cbh4dh.aspx[/url] [quote] [b]Adding and Programming Controls[/b] <snip> [b]To Set Control Properties[/b] <snip> 3. Put the insertion point in a space within the <asp:label> tag, and then press SPACEBAR. A drop-down list appears that displays the …

Member Avatar for peter_budo
0
90
Member Avatar for venizeh

Probably [URL="http://www.microsoft.com/express/vwd/"]Microsoft Web Developer 2008 Express[/URL] You should also read [URL="http://www.daniweb.com/forums/thread145124.html"]this thread[/URL], and the threads on the Web Developer's boards.

Member Avatar for Ancient Dragon
0
31
Member Avatar for MalloryOMae

Welcome to DanWeb. >>No jokes about my age, PLEASE! Naaaw. There are several other members including myself who are probably older. We don't discriminate on ancient technology or people :)

Member Avatar for Ancient Dragon
0
95
Member Avatar for Asen

unistd.h is a *nix-specific file and not supported by Microsoft compilers. I think Dev-C++ might support it though on Microsoft platform. [URL="http://www.google.com/search?hl=en&q=unistd.h+windows&aq=2&oq=unistd."]More links about that here[/URL].

Member Avatar for Denniz
0
345
Member Avatar for corrola
Member Avatar for EBaller55

You can only specify one type of loop counter. >>Is this just a bug in the Visual C++ compiler Not a bug. That type a statement is never allowed [code] int a, int b; // error int a,b; // ok [/code]

Member Avatar for ArkM
0
253
Member Avatar for PPP1

[QUOTE=PPP1;704110]Hello, I am little bit confuse for c and c++. All loops are same in both the languages so why they are different for each other?[/QUOTE] you will find the same similarities in most computer languages and that makes it easy to learn several different languages.

Member Avatar for Narue
0
158
Member Avatar for Jennifer84

[QUOTE=Sci@phy;701472]Actually, that is a list, not a vector. Minor differences, but still. Here's one way (matrix of strings): [CODE=cplusplus] typedef vector<string> row; vector<row> *vec1 = new vector<row>; [/CODE][/QUOTE] That's not managed code, but managed code is probably something similar.

Member Avatar for Jennifer84
0
169
Member Avatar for nrew

You first need to learn how to format your code -- what you posted is a huge mess which I refuse to even try to read. delete use of conio.h and studio.h -- this is a c++ program, not C.

Member Avatar for bhoot_jb
0
138
Member Avatar for Stringman

line 17: doesn't make any sense. You might as well just delete that line. line 25: you can't copy character arrays like that. Either (1) make name_sel a pointer, then line 25 will work, or (2) call strcpy() to copy the two strings.

Member Avatar for bhoot_jb
0
136
Member Avatar for dulusementara

My guess is that you forgot to include <vector> and/or [icode]using std::vector;[/icode] statement

Member Avatar for Ancient Dragon
0
332
Member Avatar for preetiman

[QUOTE=mark1993;702985]Well i dont see your website link i think it has been removed can pm me the url?[/QUOTE] Your signature: Don't you read the blogs on your own web site?

Member Avatar for mark1993
0
253
Member Avatar for rrreeefff

If this is a C program then do not code it in a file with *.cpp extension because the compiler may give some wrong error messages. Rename the file to have *.c extension for better compile messages. line 7: it should be [icode]int main()[/icode] -- you can not leave off …

Member Avatar for rrreeefff
0
155
Member Avatar for Clipper34

[code] char value; cout << "Enter a letter\n"; cin >> value; if( value == 'a' || value == 'A') { // do something } [/code]

Member Avatar for Duoas
0
127
Member Avatar for BINDERJ2

We don't do people's homework for them. You write -- we will help. Post what you know how to do then ask questions about the parts you don't know how to do.

Member Avatar for Ancient Dragon
0
304
Member Avatar for onemanclapping

class Bicicleta must implement all pure virtual methods of its base class before it can be instiantiated. It does not do that, hence the error message. Add the function [icode]virtual float calcImposto() const;[/icode] (identical to the one in Veiculo but without the =0 part) to Biciclets and it should resolve …

Member Avatar for onemanclapping
0
188
Member Avatar for wayne_owens
Member Avatar for wayne_owens
0
256
Member Avatar for DanDaMan

>>meanwhile the main problem is finding out how to include the header file But the code you posted does it correctly [icode]#include <iostream>[/icode] is all that is needed. The the compiler starts reading your program the #include statement causes it to open up the include file and add its contents …

Member Avatar for DanDaMan
0
144
Member Avatar for VernonDozier

The answers to three questions are just flat out wrong [quote]4. Which line has all reserved words ? if, else, for, while do, switch, continue, break [/quote] [b]while do[/b] is not a reserved word. [quote]8. Select the correct definition for a string variable.[/quote] Both 1 and 4 are correct answers. …

Member Avatar for VernonDozier
1
162
Member Avatar for launic
Member Avatar for Obeledeveloper

OMG either you lied like hell to land that job or your employer is pretty darned stupid for hiring you in that position. >>what causes do u think i need to do, to be able to achieve this. Quit that job and go to college full time to earn a …

Member Avatar for Obeledeveloper
0
153
Member Avatar for cplusplusgeek

You are trying to use the wrong getline(). For data type std::string you use [icode]getline(cin, videoTitle)[/icode]

Member Avatar for Ancient Dragon
0
133
Member Avatar for nizbit

yes. You shouldn't use dynamic allocation unless its really needed. Depends on the context of the rest of your program.

Member Avatar for grumpier
0
102
Member Avatar for Bigboy06

lines 72, 79 and 127. constructors can't be called directly like that. You have to instantiate an object of type Month in order to call the constructor. One way to fix the problem is to create a set function. [code] class Month { public: ... void set(int month) { if(month …

Member Avatar for ArkM
0
337
Member Avatar for slayman89

What you posted looks ok, so the problem is after that while loop. If its prompting for more user input, such as a string, then you have to clear the input stream of the '\n' that's still in the input buffer from inputting an integer. See [URL="http://www.daniweb.com/forums/thread90228.html"]this thread[/URL] for how …

Member Avatar for slayman89
0
249
Member Avatar for amrith92

Just zip up the whole project (minus object files) and attach them to your post so we can test it for you.

Member Avatar for TheBeast32
0
162
Member Avatar for ohnomis

[code] #include <algorithm> ... ... cout <<[color=red] fixed << [/color]result << endl; // I use this here to see the results of the factorial [/code]

Member Avatar for ohnomis
0
534

The End.