15,300 Posted Topics

Member Avatar for midgarsorm

you can use getline() with the last argument being the comma instead of the default space. [icode]getline(ins,Lastname,',');[/icode]

Member Avatar for Clinton Portis
0
158
Member Avatar for LateNightCoder

line 54: for(int i=0; d[i] != 400; i+10) The condition [icode]d[i] != 400[/icode] is never met. Probably should be [icode]i != 400[/icode] or better yet [icode]i < 400[/icode]

Member Avatar for LateNightCoder
0
422
Member Avatar for shacknetisp
Member Avatar for ahoysailor

You can sort the vector without splitting it. call std::sort to do the sorting. All you have to do is to expand the resource number from 1 to 2 digits, such as "resource1" to "resource01" when you read them from the file. That way std::sort (or any other sort algorithm) …

Member Avatar for mrnutty
0
177
Member Avatar for MadeleinePV

[icode](*m_log) << "message;[/icode] The parentheses are not necessary. Just do this: [icode]*m_log << "message";[/icode]

Member Avatar for mrnutty
0
973
Member Avatar for wmurrow

The while statement on line 54 is not going to work correctly because it will cause the lzst record in the file to be read twice. One way to fix that is like this: [code] int numRecords = 0; while( ReadRec(inFile, site) ) { ++numRecords; // blabla } ifstream& ReadRec(ifstream& …

Member Avatar for wmurrow
0
110
Member Avatar for potpaLaptop

Do you know how to allocate arrays? Do you know how to read a file? If not, then you need to study them before doing the rest of this program.

Member Avatar for Ancient Dragon
0
128
Member Avatar for marcux

You could just google for the file name, such as google for "sys/types.h", or just use a text editor to view the file that is stored on your computer. Or ... buy a book that contains all the information.

Member Avatar for Schol-R-LEA
0
121
Member Avatar for NoUserNameHere

[URL="http://lmgtfy.com/?q=c%2B%2B+linked+list+tutorial"]I'd start learning here[/URL]

Member Avatar for Narue
-1
89
Member Avatar for rockerjhr

after allocating the array you have to initialize it to 0 so that strcat() will work correctly the first time. You also have to null-terminate the array after the loop is finished so that printf() will work correctly. Both issues can be solved at the same time by calling memset() …

Member Avatar for Narue
0
128
Member Avatar for Ancient Dragon

The posts in [URL="http://www.daniweb.com/software-development/c/threads/398622"]this thread[/URL] are in backwards order (newest post first). I looked at other threads in which I did not contribute and they appear in normal order (oldest post first). The creation times of the two posts are reversed.

Member Avatar for Dani
0
133
Member Avatar for begyu

>>ReadDir4.cpp:44: error: ‘struct TFile’ has no member named ‘d_name’ Lear how to recognize the errors in your program. This one is pretty simple and straight forward. Look at the declaration of TFile, located at the top of your program. Notice that is does not have a member named d_name. Now …

Member Avatar for Ancient Dragon
0
1K
Member Avatar for c fan

CSV format is pretty simple -- each record is separated by '\n', as it is in almost every normal text file. Each field is separated by either a comma ',' or a tab '\t'. Which one you use is up to you and might depend on the data to be …

Member Avatar for Ancient Dragon
0
240
Member Avatar for Arkinder
Member Avatar for Arkinder
0
396
Member Avatar for JwhateverJ
Member Avatar for cox44
0
927
Member Avatar for mravignesh

You need to write code in the OnClick event handler. While in the designor just click the button and the IDE will generate an OnClick event handler for you.

Member Avatar for Ancient Dragon
0
33
Member Avatar for apert

not that hard, just locate the first numeric digit then copy both parts to new char arrays [code] char str[] = "staff101"; char s1[6], s2[6]; strnapy(s1,str,5); // copy first 5 characters strcpy(s2,&str[4]); // copy remaining characters [/code] >>any idea guys if c++ can generate pdf See [URL="http://stackoverflow.com/questions/58730/open-source-pdf-library-for-c-c-application"]this thread[/URL]

Member Avatar for Ancient Dragon
0
157
Member Avatar for trinetra31

The compiler did not create the dtmf.exe file for some reason. To compile the program as C all you have to do is rename the file dtmf.c instead of dtmf.cpp

Member Avatar for Ancient Dragon
0
287
Member Avatar for fmasroor

why download an old and ancient version 6.0? Get the free current version vc++ 2010 Express, easily located by google. >> I can provide the header files myself Are you sure? There are a couple hundred of them. If you insist on version 6.0 you will also have to install …

Member Avatar for jwenting
0
310
Member Avatar for Thermalnuke
Member Avatar for DmytriE

The while loop is incorrect -- make sure currentPtr != NULL before this loop starts! [code] while( currentPtr->next != NULL) { // blabla } currentPtr->next = newPtr; [/code]

Member Avatar for Ancient Dragon
0
127
Member Avatar for dgreene1210

line 87: pWalker is an uninitialized pointer and your program is bound to crash. You need to initialize it with the value of the parameter pList. As for the problem you asked about, please tell us which line in the code you posted the error occurs.

Member Avatar for Ancient Dragon
0
716
Member Avatar for Jdan2388

The loop starting on line 38 never increments the i counter, causing everything to be read into the same element of all the arrays.

Member Avatar for Ancient Dragon
0
176
Member Avatar for fmasroor

Those warnings mean that Microsoft compilers now consider standard functions declared in string.h to be depreciated and unsafe to use. You can disable that warning, at your own risk, if you choose to ignore it. [icode]#pragma warning(disable: 4996)[/icode] Put that somewhere at the top (after include files) of the *.c …

Member Avatar for Moschops
0
535
Member Avatar for MechMOn

My guess is the problem is the : [code] wxLegendWindow::wxLegendWindow( wxWindow *parent) ; // <<<< replace the colon wxWindow(parent, -1, wxDefaultPosition, wxSize(LEGEND_WIDTH,LEGEND_HEIGHT)) m_WinParent(parent); [/code] Another possibility is that there are too many ) [code] wxLegendWindow::wxLegendWindow( wxWindow *parent, wxWindow(parent, -1, wxDefaultPosition, wxSize(LEGEND_WIDTH,LEGEND_HEIGHT), m_WinParent(parent)); [/code]\

Member Avatar for Ancient Dragon
0
171
Member Avatar for Dani

Happy Birthday! Sorry, but I can't make it, so instead I'm sending you lots of virtual kisses :)

Member Avatar for nalini@121
4
418
Member Avatar for jeevsmyd
Member Avatar for mike_2000_17
0
225
Member Avatar for jeevsmyd

Since the class has no public members it can't be used in main() But to answer your question, it is common practice to have multiple constructors as long as they have different parameters. Only one constructor will get called, the one with the same type of parameters as the calling …

Member Avatar for Ancient Dragon
0
115
Member Avatar for luisborlido

The problem is just the came as in any other c++ program -- the global method must have an instance of the c++ class in order to call one of its methods, unless the c++ class method has been declared as static. [code] class foo { public: static int static_method() …

Member Avatar for luisborlido
0
320
Member Avatar for cka91405

call getchar() to read the file one character at a time, something like this [code] #include <stdio.h> #include <stdlib.h> int main(int argc, char *argv[]){ FILE* fin; int a, i; char myString[5]; fin=fopen(argv[1],"r"); fscanf((fin,"%d", &a); for(i = 0; i < a; i++) myString[i] = (char)getchar(); mystring[i] = '\0'; printf("%s\n", myString); return …

Member Avatar for teo236
0
381
Member Avatar for coroshea

>> foundDecade(string decade) what have you tried ? Since each instance of Celeb::name contains both name and decade just a simple search for some name will not work. To make searches less complicated you might want to split Celeb::name into two separate items: name and decade. [code] class Celeb { …

Member Avatar for coroshea
0
281
Member Avatar for dannyc116

You are not saving the file contents, your program just reads the file and tosses away the information. Turn the program around, first prompt for user name and password, then read the file, making the comparison for each line of the file.

Member Avatar for Clinton Portis
0
7K
Member Avatar for ExpertsGuide

Also make sure the PATH environment variable isn't very long. TC is a 16-bit compiler and can't handle long environment variables like 32/64-bit programs can. You may have to use a batch file to shorten the path to only essential directories.

Member Avatar for Adak
0
963
Member Avatar for pseudorandom21

I always donate unneeded clothing to [URL="http://www.goodwill.org/"]Goodwill[/URL]

Member Avatar for Ancient Dragon
0
60
Member Avatar for waqarrashid33

It depends on the operating system, but in MS-Windows you first have to empty the folder. Or you can call the shell command "rmdir -S" to remove all the files and folders. [icode]system("rmdir -S c:\mydir");[/icode]

Member Avatar for Ancient Dragon
0
34
Member Avatar for happygeek

The problem is not limited to the UK -- its a big problem here in the USA too, and I assume other countries as well. I know a woman I worked with who was widowed, and within a week was out looking for another man. She found one online who …

Member Avatar for Ancient Dragon
0
525
Member Avatar for ineedurhelp

what compiler are you using? resource.h must be in the same directory as the project *.cpp or *.c files.

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

depends on the operating system if you want GUI shapes what look like the shape should. But if you are a beginner that is way to far advanced for you. But if you're looking for punishment, you can use [URL="http://msdn2.microsoft.com/en-us/library/ms536795.aspx"]Windows GDI functions[/URL]

Member Avatar for Fuseteam
1
5K
Member Avatar for diafol

Windows 7, Google Chrome. No problem logging out. When you log out you should see this screen

Member Avatar for diafol
0
235
Member Avatar for Ancient Dragon

Today is an American Thanksgiving holiday and we typically gorge ourselves with turkey, sweet potatoes, mashed potatoes, salads, and desserts. If you cook all that at home there is normally enough left overs to last as week or so. This year we decided not to bother with all that cooking …

Member Avatar for Netcode
0
103
Member Avatar for dedmon

where is the function readint ? How is ecx set to the number of integers that the user wants? Maybe its set in readint?

Member Avatar for dedmon
0
162
Member Avatar for crysoberil

If MS-Windows you have to add an entry in the registry under HKEY_CLASSES_ROOT. If you run regedit.exe and scroll through that key you will see how others do the same thing, just make sure you don't accidentally change anything because you can potentially screw up the entire operating system.

Member Avatar for Ancient Dragon
0
114
Member Avatar for ratatat

What version of vc++ 2008 are you using? Express, Pro, etc. The Express version doesn't come with rc.exe but the others do.

Member Avatar for Ancient Dragon
0
88
Member Avatar for slygoth

duplicate thread. See answer [URL="http://www.daniweb.com/software-development/cpp/threads/396129"]here[/URL]

Member Avatar for peter_budo
0
195
Member Avatar for slygoth

concatenate the two strings before calling system [code] string fname; string pick; cin>>fname; cout<<"Do you want to open the file?"; cin>>pick; if(pick=="yes") { string command; command = "umplayer.exe " + fname; system(command.c_str()); } else cout<<"Thanks for your time; [/code]

Member Avatar for WaltP
0
255
Member Avatar for Mohit Malhotra

If you are using Turbo C then most likely delay() is in dos.h. But if you are using a modern compiler then there is no such function. MS-Windows has a Sleep() function and *nix has sleep().

Member Avatar for Ancient Dragon
0
6K
Member Avatar for mcclainra

line 16 is wrong. The parameters are only variable names, not the variable size [icode]decode (crypted_string, uncoded_string, key);[/icode]

Member Avatar for mcclainra
0
228
Member Avatar for ~s.o.s~
Member Avatar for subith86

Maybe calculateAvailableUnits() need to round the return value to 2 or 3 decimal places so that it will return 30.00. The problem you are describing in the comparisons will most likely show its ugly head up in other places in your program too.

Member Avatar for Tumlee
0
203
Member Avatar for Ancient Dragon

Check out this [URL="http://www.youtube.com/watch?v=Id_kGL3M5Cg&NR=1"]Youtube video[/URL]

Member Avatar for cwarn23
0
226

The End.