15,300 Posted Topics

Member Avatar for PoolShark1

If you read the class description in Resistor.h you will notice that none of the three constructors takes 4 arguments. If you are not allowed to change that, then your only alternative is to change the lines in ResistorMain.cpp by removing one of the arguments so that they match the …

Member Avatar for PoolShark1
0
201
Member Avatar for salem13

If you use [icode]vector<int>[/icode] then you can use std::sort() to sort the numbers. [code] start of loop read a line split line into individual integers and put into vector call std::sort display values end of loop [/code] you can do the same with simple int array instead of vector, but …

Member Avatar for salem13
0
135
Member Avatar for hwoarang69

Fist of all, fscanf() will not give you "black cat" because it will stop reading the file when it encounters the first space, so all it will give you on the first iteration of that loop is "black". Your use of strtok() in this instance is unnecessary because the line …

Member Avatar for hwoarang69
0
75
Member Avatar for ilovephil

>>#define p printf >>#define s scanf Horrible misuse of macros. Don't be so lazy and just type out the word printf and scanf when needed. >>Link list strings stored rewrite this program The structure is incorrect. You need to add the star to the declaration making nbook a pointer so …

Member Avatar for Ancient Dragon
0
210
Member Avatar for tungnk1993

There are several programs that could have been used -- [URL="http://www.cdw.com/shop/search/software-titles/autodesk-autocad.aspx?&cm_mmc=acquirgy-_-google-_-CDW+Co+Op+AutoCAD+Inventor+2-_-AutoCAD&AcquirgyID=Cpz6PcNW"]Autodisk AutoCAD[/URL] is among the 15-20 programs.

Member Avatar for CriticalError
0
106
Member Avatar for www.daniweb.com

TCHAR is a macro -- you can't convert System::String to a macro, it doesn't make any sense. You can convert it to char* or wchar_t*, depending on whether you are compiling for UNICODE or not, but can't convert it to a macro. See [URL="http://msdn.microsoft.com/en-us/library/system.string_methods.aspx"]ToCharArray() here[/URL]

Member Avatar for www.daniweb.com
0
216
Member Avatar for bradhal
Member Avatar for jbennet
0
192
Member Avatar for FraidaL

You may need to rearrange your program a bit, removing the if-then-else statemet. [code] beginning of loop ask for user input if input is valid then exit the loop display error message end of loop display message that input is valid [/code]

Member Avatar for Tygawr
0
395
Member Avatar for avi75

Do you have antivirus and antispyware programs running on the computer? If not then you need to get them.

Member Avatar for rmazzeo
0
441
Member Avatar for MandrewP

Rebuilding DaniWeb is not an option. Ms Dani is in the middle of a major upgrade. Use code tags to make it retain formatting [noparse][code] // your stuff goes here [/code] [/noparse] If that doesn't work for you then you can just take a screenshot of your computer and attach …

Member Avatar for Nick Evan
0
108
Member Avatar for ClausL

I see the same behavior using vc++ 2010 express on 64-bit Windows 7. The memory eventually went back down to normal level after a couple minutes. I think the problem is that the program does not release memory back to the operating system so that Task Manager can see it, …

Member Avatar for Ancient Dragon
-1
77
Member Avatar for soo5Lo6k
Member Avatar for xtinab

>> I get an error that says "cannot instantiate an abstract class" even though it is instantiated in a .cpp. Classes that contain pure virtual functions can not be instantiated o their own -- inherited class must implement the function and the inherited class must be instantiated. SubdomainPart is not …

Member Avatar for Ancient Dragon
0
222
Member Avatar for rigoalhn

First of all you don't have to repeat [b]private[/b] before each object. The access modifier is good until you change it to something else [code] class date { private: int day; int month; int year; }; [/code] Next, you need to provide the three public constructors that are in your …

Member Avatar for Ancient Dragon
0
3K
Member Avatar for zingwing

Maybe you are confusing EOF with end-of-string NULL terminators? The last character of a standard C or C++ string is '\0', which is called a NULL terminator.

Member Avatar for Ancient Dragon
0
146
Member Avatar for kevindougans

why not just create your own web site where you can store anything you want on the file system. This would also eliminate the possibility that anyone on the internet can view the files -- your files could be much more secure from the public.

Member Avatar for Afshispeaks
0
260
Member Avatar for greatman05

The derived class just calls the base classes public member functions, they can not change the value of private member data objects or call private functions.

Member Avatar for Ancient Dragon
0
208
Member Avatar for Tygawr

[URL="http://www.fileformat.info/info/unicode/utf8.htm"]Here[/URL] is an explanation of utf8 file format. Note that the first two bytes may be a binary integer -- see the chart at the end of that link.

Member Avatar for thines01
0
7K
Member Avatar for Jorox03

>>if( line.find( keyword ) ){ Should be this: [icode] if( line.find( keyword ) != string::npos ){[/icode] >>how to input a way of tracking line numbers. Just add an integer to count the lines as they are read. Something like this: [code] int linecount = 0; ... cout << "line: " …

Member Avatar for WaltP
0
214
Member Avatar for skilly

There will be no arks since its the end of the world. The end will come due to our sun exploding or collision with an asteroid, not because of a flood.

Member Avatar for skilly
0
105
Member Avatar for korek
Member Avatar for gunnerone

wouldn't it be a lot easier to just check if the string contains @ and a period? Seems like regex is overkill for this application.

Member Avatar for Ancient Dragon
0
1K
Member Avatar for Torger

Is [URL="http://technetsrilanka.net/blogs/bubble/archive/2011/01/01/microsoft-multiport-server-2011-beta-availability.aspx"]this[/URL] an example of what you are talking about?

Member Avatar for jbennet
0
233
Member Avatar for tamana

[code] int odd = 0; int even = 0; // now prompt for some values not shown here // I'll leave that up for you to figure out. // print the values printf("odd = %d, even = %d\n", odd,even); [/code]

Member Avatar for Lerner
0
418
Member Avatar for Shaye12321
Member Avatar for Shaye12321
0
1K
Member Avatar for PrimePackster

Real programmers don't need Intellisense because they have memorized the syntax or know how to read the docuomentation and all that does is slow them down :)

Member Avatar for Ancient Dragon
0
182
Member Avatar for slygoth

how to do it will depend on the operating system and possibly the compiler you are using.

Member Avatar for Ancient Dragon
0
138
Member Avatar for Johnathon332

[QUOTE=gerard4143;1778428]If you really need to jump all over your program try a safe function like longjmp(). [code] void longjmp (jmp_buf env, int val); int setjmp ( jmp_buf env ); [/code][/QUOTE] Wrong. longjmp() and setjmp() are not supported in c++ program. I have used goto on very very rare occasion when …

Member Avatar for mike_2000_17
0
189
Member Avatar for FireBlah

That's because you have to either add a call to keyboard input so that the program waits for you to press a key, or run it in its own cmd window.

Member Avatar for FireBlah
0
117
Member Avatar for dymatic

You are passing item objects to those functions by value instead of by reference. change the function parameter list to use reference & operator so that the item struct will retain its value when control is returned to main()

Member Avatar for Ancient Dragon
0
259
Member Avatar for nunca
Member Avatar for Programming++

line 31: Never ever for any reason call main() from any part of a program. In the example you posted use a loop. line 23: what is cls? That line doesn't make any since at all.

Member Avatar for mazzica1
0
211
Member Avatar for revenge2

Why would you want to do that? Just use Code::Blocks and you have it done, and probably much better too. And Code::Blocks contains a debugger, which Notepad++ does not.

Member Avatar for jussij
1
853
Member Avatar for tom12

Can't answer your question until I see your program. Why do you need to recompile just to choose another option? All you have to do is prompt for the option number and run a switch statement for the option. If you want to choose another option just put all that …

Member Avatar for Ancient Dragon
0
92
Member Avatar for nuclear

| is a bit operator. See [URL="http://www.cprogramming.com/tutorial/bitwise_operators.html"]this tutorial[/URL]

Member Avatar for VernonDozier
0
245
Member Avatar for slygoth

Call fgets() to read entire lines of a file [code] char line[255] = {0}; myfile=fopen("garrudaRanch.txt ","r+"); if( myfile != NULL) { while( fgets(line, sizeof(line), myfile ) { // do something } fclose(myfile); } [/code]

Member Avatar for Ancient Dragon
0
135
Member Avatar for animeocarl

Yes, that is odd using true to indicate the number of elements in an array. true is used for boolean operations, such as true or false, and you can't count on true being equal to 1, it could be -1 in some implementations. Another point -- get rid of all …

Member Avatar for Ancient Dragon
0
224
Member Avatar for nitigya92

Your program is missing some header files that your compiler should have complained about. For example, va_start is undefined because you failed to include the header file that defines it. Learn to use google to find out where va_start is declared. You will save yourself an awful lot of time …

Member Avatar for Ancient Dragon
-2
131
Member Avatar for Suzie999

>>Now the next part of my plan is a way to convert this char* representation of a pointer which will be passed in, to the actual numeric value of it. Forget that idea, it won't, and can't work for reasons previously given. Pointers can not be passed between processes because …

Member Avatar for Suzie999
0
901
Member Avatar for linkingeek

The second program is wrong because line 8 is not passing a pointer to pointer, but pointer to pointer to pointer, which means that function pointer should have three stars, not two.

Member Avatar for versan
0
166
Member Avatar for ThomsonGB

It is customary to have program options to start with either - or /, such as -key or /key. Sometimes you may want an option to be something like "-key=Something", and you may also want to allow for spaces within the string, for example you may type on the commandline …

Member Avatar for ThomsonGB
0
139
Member Avatar for ahp@aol.in

In MS-Windows WaitForSingleObject() you can specify a time limit for the lock to happen.

Member Avatar for ahp@aol.in
0
188
Member Avatar for adi701

Deposit $1Million USD in my PayPal account and I'll gladly do your homework for you. Otherwise, if you can't or won't do that, then post the code you have so far and we'll talking about the problems you are having.

Member Avatar for Ancient Dragon
0
34
Member Avatar for nizbit

1) It shouldn't matter if the length of the search string is the same as the replacement string. When the search string is found, copy the original string up to the beginning of the search string, then append the destination string, finally move the pointer past the end of the …

Member Avatar for WytCZ
0
1K
Member Avatar for Adnan671

1. Change four functions in fairy.h to pure virtual functions and remove the corresponding functions from fairy.cpp. You will also have to declare the same functions in each of the other header files as just virtual. [code] // fairy.h virtual void askForWish() = 0; virtual void helpFairy() = 0; virtual …

Member Avatar for Adnan671
0
134
Member Avatar for hust921

>>so i can skip the "int strSize = sizeof(str);" in every function. Just as well because sizeof does not return the length of the buffer, only the size of a pointer (which on 32-bit compilers is 4). What you will probably have to do is pass the size of the …

Member Avatar for hust921
0
300
Member Avatar for nivek10

The parentheses are used to tell the compiler that the code inside is a typecast, which changes the datatype of variable msg from void* to class1*.

Member Avatar for nivek10
0
379
Member Avatar for ThomsonGB

>>c--; The initial value of c is too large. The value of argc is the number of strings in the array. So it counts from 0 to argc-1. You should make the loop as you would when using any other array [code] for(int i = 0; i < argc; i++) …

Member Avatar for ThomsonGB
0
1K
Member Avatar for utkarshsahu

In a program? None. makefiles are not used by programs, they tell the compiler how to compile the program.

Member Avatar for utkarshsahu
0
136
Member Avatar for jonnyboy12

[URL="http://msdn.microsoft.com/en-us/library/a6cskb49(v=vs.80).aspx"]See this thread[/URL] for how to code managed enumerations. There should be no colon after the word public.

Member Avatar for Ancient Dragon
0
221

The End.