15,300 Posted Topics

Member Avatar for Leila1

1. Just attach the file to your post here. Nobody will download that file for fear it might contain viruses or worms. 2. Why don't you translate it yourself.

Member Avatar for Leila1
-1
462
Member Avatar for CppFTW

It is compiler dependent. Some compilers might define DEBUG, others _DEBUG, and still others might not define it at all. IMHO the best way to do it is to define the macro yourself in command-line options, such as -DDEBUG.

Member Avatar for CppFTW
0
262
Member Avatar for CppFTW

delete that while loop -- no loop is necessary with the code you wrote because it reads and writes the entire file in one big swoop. That isn't practical for large files, but ok for fairly small ones. And you need to open both files in binary mode -- just …

Member Avatar for CppFTW
0
146
Member Avatar for lalafam

line 4: move it up above liine 1 line 13: for (int Hour=1; Hour <= 24; Hour++) That is wrong. Arrays are numbered from 0 to (and including) 23, so it should be written like this: [icode]for (int Hour=0; Hour < 24; Hour++)[/icode] line 15: Emp = Cust/20 + 3; …

Member Avatar for lalafam
0
120
Member Avatar for Aggresive_Mind

>>If You Want Something To Do, Try This Exercise... Ok, wrote, compiled and debugged in 22 minutes. Except I used a linked list instead of an array. (This is my day off from work so I have lots of time to spare :) )

Member Avatar for Salem
0
138
Member Avatar for an_ashu

read the two files into memory then call memcmp() to compare them. Or, if MS-Windows, use the COMP program (create a command window, then type [icode]c:>Help <Return>[/icode] and view the available commands.

Member Avatar for Ancient Dragon
0
63
Member Avatar for kaio-ken

Probably your compiler because it worked ok for me after correcting the header files as previously explained.

Member Avatar for pwl
0
124
Member Avatar for adarshcu

[QUOTE=jephthah;882237] but the memory has not been [B]allocated[/B], so if you try to modify it the resulting behaviour is undefined. .[/QUOTE] The problem is NOT that memory was not allocated for the string (actually it was), but that the string resides in (probably) read-only memory, depending on how the compiler …

Member Avatar for adarshcu
0
71
Member Avatar for TheBattlizer

You might want to put code guards in that header file to prevent the problem you describe. [code] #ifndef POINTS_H #define POINTS_H struct Points { int xCoordinate; int yCoordinate; int zCoordinate; }; // end of struct Points definition #endif [/code]

Member Avatar for ArkM
0
2K
Member Avatar for ttqtrang146

you need to allocate one more byte than file size for the string's null-terminator, then add the null terminator after the read() operation. [code] char* data_block=new char[(int)size+1]; file.seekg(0,ios.beg); file.read(data_block,size); data_block[size] = 0; file.close(); [/code]

Member Avatar for ttqtrang146
0
182
Member Avatar for azjherben

[QUOTE=azjherben;879662]Page not found?[/QUOTE] try the links again -- they worked ok for me.

Member Avatar for azjherben
0
128
Member Avatar for Ancient Dragon

[URL="http://www.youtube.com/watch?v=bhcA4Ry65FU"]Happy Mother's Day [/URL]to all you moms out there. :) ;) Us guys couldn't survive without you. [URL="http://www.youtube.com/watch?v=HAxfh8ukosQ"]Narue on Mother's Day[/URL]

Member Avatar for jephthah
0
127
Member Avatar for Aia

[QUOTE=Aia;876925]Since you didn't care to express your opinion in a decent post, allow me to copy it for you, so I can make a reference to it. What do you mean by "I rarely give bad rep except here"? What prompts you to give a bad rep here? Why is …

Member Avatar for jephthah
-1
765
Member Avatar for TheBattlizer

I assume you want to pass the entire array to that function, then don't specify the array size. I'd also pass the element number that you want used in the sprintf() call. [code] void DisplayPoints(Point point[], int index){ sprintf(xCoordinateText,"%.0f", point[index].xCoordinate); BasicFunctionsCode.render2DBitmapText(1080, 100, font, xCoordinateText); } // end of DisplayPoints [/code]

Member Avatar for TheBattlizer
0
142
Member Avatar for serkan sendur

You can execute another program on PPC the same way you do it on a PC. CreateProcess() win32 api is one way. Remember, PPC does NOT have a command prompt, so system() is not available (as I recall). There is also no such concept as [b]current working directory[/b] or [b]change …

Member Avatar for serkan sendur
0
111
Member Avatar for saiaditya007

[QUOTE=Topi Ojala;880523]Quick, before the mods get here! Add the code tags ![/QUOTE] Its not really worth the effort :)

Member Avatar for saiaditya007
0
101
Member Avatar for Ancient Dragon

DaniWeb is very sloooow today. Are you doing server maintenance -- again?

Member Avatar for Ancient Dragon
0
57
Member Avatar for ddanbe

You could go to your CONTROL PANEL --> Edit Options and uncheck this option box. Other than that there is little that we can do about it. [quote] you can allow other members to send you email messages. [ ] Receive Email from Other Members [/quote]

Member Avatar for ddanbe
0
87
Member Avatar for bufospro
Member Avatar for Luckychap
0
113
Member Avatar for nagu89

[QUOTE=nagu89;880679]Will both you guys please stop fighting and try helping me out?[/quote] Agree. [QUOTE=nagu89;880679]but I guess my compiler is the culprit. Guys. - Let me know of a decent compiler and where to download it[/QUOTE] You never did say what compiler you are using, or even what operating system (*nix, …

Member Avatar for Ancient Dragon
0
231
Member Avatar for tartan

[code] for ( int i=0;i<row;i++ ) { if (custn == customers[i].custno) { <snip> } else errorMsg("Invalid Option"); } [/code] It would appear the logic is wrong. Unless the very first item in the array is always the custn its looking for then the program will always display the error message.

Member Avatar for Ancient Dragon
0
178
Member Avatar for vs49688

The same way std::string does it [code] class String { public: String(); String(char *str); ~String(); String& operator= (char *str); operator char* (); [color=red] const char* c_str() {return szStr;} [/color] bool operator== (char *str); private: char *szStr; }; [/code]

Member Avatar for ArkM
0
317
Member Avatar for mirfan00

[URL="http://lmgtfy.com/?q=how+to+use+msado15.dll+with+c%2B%2B"]See This[/URL]

Member Avatar for mirfan00
0
67
Member Avatar for patria987

what do you mean by [URL="http://www.google.com/search?source=ig&hl=en&rlz=1G1GGLQ_ENUS328&=&q=+c%2B%2B+magic+numbers&btnG=Google+Search&aq=f&oq="]magic numbers?[/URL] Example: [icode]int i = 123;[/icode] the "123" is considered a magic number. Is that what you mean?

Member Avatar for Salem
0
175
Member Avatar for Usura

<map> doesn't allow duplicates. And with map you don't even need that structure, unless it contains other things that you didn't post here. [URL="http://kengine.sourceforge.net/tutorial/g/stdmap-eng.htm"]Example code here.[/URL] [URL="http://msdn.microsoft.com/en-us/library/e8wh7665(VS.80).aspx"]std::set container [/URL]also don't allow duplicates and are sorted.

Member Avatar for siddhant3s
0
187
Member Avatar for Richy321

I tried to compile it with vc++ 2008 express and got other errors. Must be some header files missing -- I have no idea how to correct them. [quote] 1>c:\dvlp\test2\test2\debug\msado15.tlh(2375) : error C2059: syntax error : '<L_TYPE_raw>' 1>c:\dvlp\test2\test2\debug\msado15.tlh(2375) : error C2238: unexpected token(s) preceding ';' 1>c:\dvlp\test2\test2\test2.cpp(27) : error C2065: '_RecordsetPtr' …

Member Avatar for Richy321
0
216
Member Avatar for hetngay

[QUOTE=iamthwee;880804] Those links at the top leads me to believe this is just a cheap attempt to spam and yes if you look at his post history that confirms it.[/QUOTE] spamy links don't necessarily make the entire post spam.

Member Avatar for Ancient Dragon
0
156
Member Avatar for DarthPJB

I guess its time for you to toss what you've done into the bit bucket and do it again the right way.

Member Avatar for DarthPJB
0
130
Member Avatar for ttqtrang146

why did you bother creating that pointer just to pass to a function? All you have to do is pass string's c_str() [icode]WriteFile(str.c_str());[/icode] >>line #9: cin.widen('\n') What is that supposed to do -- unless you compile for UNICODE it will do nothing. Seems more reasonable to just do this: [icode]getline …

Member Avatar for ttqtrang146
0
132
Member Avatar for frowlaya

lines 13-40 do the same thing over and over for 81 times!:icon_eek: What's the point of doing that? delete line 12 because lines 13-40 initialize the array with other numbers. lines 61 and 64: what is [b]comp false;[/b] ? There is no such thing as [b]comp[/b]

Member Avatar for frowlaya
0
142
Member Avatar for yakovm

Stay away from those pointers. lines 8-10: delete those lines lines 16-18: [code] p.push_back(string("s1")) ; p.push_back(string("s2")) ; p.push_back(string("s3")) ; [/code] With the above changes you don't have to worry about a destructor because the vector and string classes with destroy themselves.

Member Avatar for yakovm
1
108
Member Avatar for Jupiter 2

If you post something in the wrong forum, just hit the "Flag Bad Post" blue link and request a mod to move it to somewhere else. We realize people are not perfect and sometimes make mistakes. You will not get any grief from any of the moderators if you ask …

Member Avatar for Narue
0
201
Member Avatar for rtwister

variable [b]password[/b] is only a single character, which means it will accept only one character. If you want it to accept many more characters then declare it as an array of characters, or a std::string object, like this: [icode]char password[255] = {0};[/icode]. That lets you type up to 254 characters …

Member Avatar for tux4life
0
104
Member Avatar for kesh1000

If you read all that data into memory at the beginning of the program you can then write a simple function to display the information. [list=1] [*] create a structure that contains each of the fields in the file [*] read the file into an array of structures [*] use …

Member Avatar for Ancient Dragon
0
104
Member Avatar for yashyash

how do you know it does not convert the entire file? Did you write another program to read back all that binary data and compare it with the original file?

Member Avatar for Ancient Dragon
1
182
Member Avatar for abhishek2301

probability of what? Apples are red? Sky is blue? Grass is yellow? How is the probability variable calculated? Just a random number? So you want to increment the counter if there is a 50-50 chance of something happening?

Member Avatar for ArkM
0
140
Member Avatar for Ameerah

If you have to write your own sort function, google for "sort algorithms", or for "bubble sort"

Member Avatar for ArkM
0
198
Member Avatar for Behi Jon

You failed to write the Array class's constructor implementation code. [code] #ifndef ARRAY_H #define ARRAY_H #include <iostream> using namespace std; template < typename B > class Array { friend ostream &operator << ( ostream &, const Array < B > & ); friend istream &operator >> ( istream &, Array …

Member Avatar for Ancient Dragon
0
187
Member Avatar for Abderian

post a small example program that has the problem you describe because I don't quite understand what you are talking about.

Member Avatar for Abderian
0
203
Member Avatar for Jupiter 2

>>I thought the discussion forum was for suggestions. It is -- but you didn't post a suggestion. Geek's Lounge is where you can post silly and/or off-topic stuff. About the only time you will get kicked off there is if you post technical support questions, profanity, porn, advertisements, or flame …

Member Avatar for Ancient Dragon
0
240
Member Avatar for MosaicFuneral

[URL="http://www.programmingforums.org/thread22226.html"]Sane [/URL]on PFO posts monthly challenges. You could join in there with your own challenges.

Member Avatar for Ancient Dragon
0
162
Member Avatar for thornside

continue program exception in the catch block. [code] void foo() { cout << "foo() is throwing an excetption\n"; throw 1; } int main() { try { foo(); } catch(...) { cout << "Exception caught\n"; } cout << "Ending program\n"; } [/code] Output is this: [quote] foo() is throwing an excetption …

Member Avatar for thornside
0
10K
Member Avatar for mirfan00
Member Avatar for mirfan00
0
202
Member Avatar for ultrAslan

[quote]Any extra work is strictly optional, for your own benefit, and will not directly affect your grade[/quote] Bummer!:(

Member Avatar for Ancient Dragon
0
72
Member Avatar for MrNoob

I would have done it slightly different what what William posted -- initialize the value of [b]num[/b] with the first element of the array on line 10, then line 21 of his code could be deleted.

Member Avatar for jephthah
0
139
Member Avatar for serkan sendur

you mean a wireless device such as a cell phone or barcode scanner? I would imagine it would depend on the compiler and the device type. I've done programming with Mobile 5.0 and Pocket PC operating systems on a barcode scanner (Symbols and Intermec) Those two scanners have completely different …

Member Avatar for Ancient Dragon
0
314
Member Avatar for Takafoo

you will have to post bintree.h if you want anyone to compile and test your code.

Member Avatar for Takafoo
0
180
Member Avatar for goyofoyo

That compiler can build GUI programs in which you can draw circles, rectangles, and other graphic shapes. Does your teacher expect graphic shapes or text shapes ? Are you in a first year programming class ? If yes, then I suspect your teacher only expects text shapes because graphic shapes …

Member Avatar for Ancient Dragon
0
121
Member Avatar for DarthPJB

line 6 is unnecessary. you are not null-terminating the destination string. wcslen() returns the number of characters in the string and does not include the null terminator. So add a line after line 10 to null terminate the destination string. You could also have just used wcscpy() and not bother …

Member Avatar for Ancient Dragon
0
106
Member Avatar for SallyJ
Re: Loop

k does not loop at all. Its only an integer that sums up the values of j in the last iteration of that i loop. So the final value of k should be 3 + 0 + 1 + 2 + 3 = 9.

Member Avatar for jesseb07
0
149

The End.