15,300 Posted Topics

Member Avatar for Crul

line 383: copying 1 too many bytes because currentSizeOfS has already been incremented by 1 to account for the null terminator. line 400: The [b]s[/b] pointer was passed by value, nor by reference, so allocation additional memory here only has scope in this function, not the calling function. Just delete …

Member Avatar for Ancient Dragon
0
118
Member Avatar for RenFromPenn

[edit]^^^ beat me to it:) [/edit] >>fscanf(inFile, "%s", text) >>printf("%s\n", text); I don't know why the file doesn't open, but the above line is guarenteed to crash. Why? Because "%s" tells scanf() and printf() the next argument (text) is a null-terminated character array, and all you passed is a single …

Member Avatar for Ancient Dragon
0
885
Member Avatar for xyzt

configuration files are just plain-ordinary text files, so just use ifstream to read them. There are several ways to format the file, one way is in the form [icode]<variable name> = <value>[/icode]. For example: [code] UserName=John Password=xxxyyy Age=18 Address=101 Any Street City=Anytown State=Illinois Country=USA [/code] The list of items in …

Member Avatar for Ancient Dragon
0
120
Member Avatar for Swemp

Try a slightly different algorithm [code] void voorkomentellen ( vector<int> getallen , vector<int>& getelde_rij, vector<int>& voorkomen ) { unsigned int i, teller; int getal1, getal2, count=1; getal1 = getallen[0]; for (i = 1; i < getallen.size( ); i++) { getal2 = getallen[i]; if (getal1 == getal2) { count++; } else …

Member Avatar for Ancient Dragon
0
159
Member Avatar for takora
Member Avatar for alunsandro
Member Avatar for Ancient Dragon
0
83
Member Avatar for vandenzergen
Member Avatar for vandenzergen
0
164
Member Avatar for Grimshad

If you want any responoses you need to state the compiler and operating system you are working with.

Member Avatar for Grimshad
0
181
Member Avatar for dwhite409
Member Avatar for dwhite409
0
164
Member Avatar for u8sand
Member Avatar for algoboy
0
165
Member Avatar for Clockowl

There are several ways to do it. One way is to use c++ stringstream class. And don't use printf() in c++ programs, it will work, but iostream is more suited to c++. [code] #include <sstring> // stringstream class int main() { int x; string y = "1234567890"; stringstream str(y); str …

Member Avatar for Clockowl
0
112
Member Avatar for Q8iEnG

I would have thought it wise to have read the chapter before doing the extercises at the end of the chapter :)

Member Avatar for Q8iEnG
0
97
Member Avatar for sneekula

According to [URL="http://www.apples4theteacher.com/holidays/chinese-new-year/when-is-chinese-new-year.html"]this[/URL], you are right :)

Member Avatar for debasisdas
0
75
Member Avatar for whipaway

Happy New Year everyone :) I didn't bother to stay up that late -- went to sleep at 9:45 pm because I have to be at work bright and early this morning.

Member Avatar for The Dude
1
346
Member Avatar for GrimJack

I know many people mistakenly believe evolution is a fact while its actually nothing more than just a good (ok very good) theory. There is no way to prove evolution, just as there is no way to prove creationism. We can believe all we want but that doesn't make it …

Member Avatar for GrimJack
0
1K
Member Avatar for cppnewb

As you probably already guessed, you don't do that with a bunch of if statements. I guess you already have a list of books with their titles and call numbers, maybe other information too. In that case, all you have to do is code a loop that searches the list …

Member Avatar for cam875
0
122
Member Avatar for RhinomanUK

OMG that must be incredibly sloooooow -- calling seek for each character! A much quicker, and more reliable, solution would be something like this: [code] unsigned char inData; while( FileHandlerFile.read((char *)&inData,1) ) DataHexArray.push_back(inData); [/code]

Member Avatar for RhinomanUK
0
180
Member Avatar for sillyboy
Member Avatar for firoz.raj

>>most urgent Maybe for you, but not for us. Describe the problem you have because we are not interested in just looking at your code and try to read your mind. And next time try to be a little more creative in the title of your threads. [edit]Merged your two …

Member Avatar for Ashwani_chaudha
0
479
Member Avatar for mrnutty

cout<<[color=red]fixed << [/color]setprecision(50)<<"i is : "<<i< ... Don't be supprised when it displays this: [quote] i is : 100 fact is : 933262154439440900000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 000000000000000000000000.00000000000000000000000000000000000000000000000000 [/quote]

Member Avatar for MosaicFuneral
0
148
Member Avatar for isumasama

>> almsot forgot on how to code in C or C++ you need to refresh your memory before continuing or you will get nowhere very fast. Dig out those old text books you bought (you DID keep them didn't you?) and do a few of the end-of-chapter examples. I have …

Member Avatar for MosaicFuneral
0
949
Member Avatar for Ancient Dragon

In case you have not heard yet, the Illinois governor was arrested today for attempting to sell the state's senate seat that Mr. Obama held to the hightest bidder. I'm supprised he didn't try to sell it on eBay. That isn't the end of it -- he was thinking of …

Member Avatar for GrimJack
0
156
Member Avatar for majesticmanish

Assert is only one debugging tool, and does nothing if you compile the program for release instead of debug. Exception handling works in both debug and release compiles, asserts do not.

Member Avatar for majesticmanish
0
149
Member Avatar for Liinker

I have not actually worked with file mapping, but I suspect the problem is that std::string attempts to allocate memory which causes the file mapping to crash. Try replacing [icode]std::string strData[ 200 ];[/icode] with character arrays [icode]char strData[200][255][/icode] and see if that fixes the problem.

Member Avatar for Liinker
0
875
Member Avatar for Swemp

I'm not completely certain what you are attempting to do, but here is one way to do it. It is not necessary to close the file and reopen it. Just reset the stream back to the beginning of the file, as shown below. [code] std::string line; for( ;; ) // …

Member Avatar for Swemp
0
1K
Member Avatar for jbennet
Member Avatar for Frederick2

In VC++ 2008 UNICODE is turned on by default :( . AFAIK there is no way to change this default behavior when creating a project. I always have to turn it off as ArkM posted.

Member Avatar for Frederick2
0
134
Member Avatar for n321

warning c4996 -- Microsoft has declared many of the standard C functions from stdstring.h decpreciated (obsolete). The c and c++ standards say otherwise. So you have a choice: 1) ignore the warnings, they can be disabled with this pragma: [icode]#pragma warning(disable: 4996)[/icode], or 2) fix the problems by using Microsofts …

Member Avatar for n321
0
165
Member Avatar for orwell84
Re: GUI?

[URL="http://www.winprog.org/tutorial/"]MS-Windows tutorial[/URL]. You need a fundamental knowledge of the C language, c++ will work too, but not required.

Member Avatar for orwell84
0
207
Member Avatar for deenadhayalan

Welcome to DaniWeb. I'm sure there are lots of people here eager to help you. Just post your questions in the appropriate board.

Member Avatar for jbennet
0
17
Member Avatar for changdeoJ
Member Avatar for Manutebecker

[QUOTE=Salem;761064]George Best, 1973 against Liverpool - classic![/QUOTE] He said "header", not "headliner" :)

Member Avatar for Manutebecker
0
129
Member Avatar for bill2

Since you didn't post any code I can only guess that you failed to include header files and identify the namespace. [code] #include <iostream> using namespace std; ... ... /blabla [/code]

Member Avatar for bill2
0
189
Member Avatar for arunciblesp00n

I thought most modern c and c++ compilers supported some form of 64-bit integers. Try just "long long" instead of "long long int".

Member Avatar for ArkM
0
5K
Member Avatar for suljo2

You will never get exact precision with floating point because of the way they are represented in memory.

Member Avatar for ArkM
0
144
Member Avatar for amit.k.1987

What the hell are you talking about ?? DC as in Direct Current, or DC as in Washington DC?

Member Avatar for amit.k.1987
0
80
Member Avatar for Salem

Yea, go buy one and set it up in your back yard. I wounder if your neighbors will notice :)

Member Avatar for GrimJack
0
148
Member Avatar for ademsaykin

change [icode]#include <string.h>[/icode] to remove the .h extension -- [icode]#include <string>[/icode] That will not fix all your proglems will fix some of them.

Member Avatar for ademsaykin
0
299
Member Avatar for Icebone1000

Here is one of several ways to do it. Run this little program so you can see what it is doing. [code] #include <iostream> #include <sstream> using namespace std; int main() { size_t pos; string tm = "01:02:03"; char c; int h = 0, m = 0, s = 0; …

Member Avatar for Ancient Dragon
0
2K
Member Avatar for mechbas

Obviously Dani doesn't mind or she would have deleted it a long time ago.

Member Avatar for Dave Sinkula
-1
237
Member Avatar for flaco

The best part of arguing with your GF is making up and making out. Don't let disagreements linger very long, especially never ever over night. When the sun sets its time for YOU to resolve all disputes. A lasting relationship means you tell your partner "I'm sorry."

Member Avatar for techbound
0
198
Member Avatar for Ragupathiyuva
Member Avatar for The Dude

>>got it pulled from her child's kindergarten Christmas show OMG [color=red]CHRIST[/color]mas is all about religion. And there is nothing religious about that song.

Member Avatar for techbound
0
164
Member Avatar for christina>you

I'll take a couple of these: [URL="http://mywiki.ws/The_World's_Most_Expensive_and_Useless_Things"][quote]Damien Hirst’s sculpture, titled “For The Love of God”. It represents a platinum skull encrusted with 8,601 diamonds, eye and nose sockets filled with hundreds of jewels and a 52-carat pear-shaped stone fixed on the forehead, which is further bordered with 14 diamonds. It …

Member Avatar for techbound
0
484
Member Avatar for praveen_dusari

[QUOTE=praveen_dusari;697836]hey today my brother said other than thinking about subject u can do nothing n that`s why this profession suits me. i thought this must be nice topic to start if you were not in this field what u will do or which profession you will opt to start with …

Member Avatar for techbound
0
169
Member Avatar for samantha grace

double posted [URL="http://www.programmingforums.org/post155457.html#post155457"]here[/URL]

Member Avatar for samantha grace
0
235
Member Avatar for chandangang

To do that you have to get down to the nitty-gritty with the operating system. The curses library (*nix) or ncurses (MS-Windows) will make that easier for you. For MS-Windows there are several other options depending on the compiler you are using.

Member Avatar for William Hemsworth
0
180
Member Avatar for eric_carwardine

Welcome to DaniWeb. Sorry I had to snip all that information, but rules are rules. You can include some of it in your personal information in your CONTROL PANEL, link at the top of each page. There are a few of us old farts around here, welcome to the crowd …

Member Avatar for Ancient Dragon
0
227
Member Avatar for suley04

>>e.g. data1.c The file extension is somewhat important -- *.c files are normally c programs, not data files. Your data file should be names "data.txt". You need to store the data in an array of struct sale objects. What you are doing is just overwriting all the data on each …

Member Avatar for Ancient Dragon
0
470
Member Avatar for eyedeals

Have no idea what you are talking about. What is "lsass.ess"? An operating system? application program? Please post in the correct DaniWeb board. This one is only for intruductions, not questions. Tell me what it is and I'll move it for your.

Member Avatar for eyedeals
0
63

The End.