15,300 Posted Topics

Member Avatar for sfgal

Write a comparison function that compared the substrings of each string. [code] #include <iostream> #include <string> #include <vector> #include <algorithm> #include <ctype.h> using namespace std; string getsubstr(const string& s) { size_t pos = s.find('-'); string v1 = s.substr(pos+1); // now remove any leading white space characters while( isspace(v1[0]) ) { …

Member Avatar for sfgal
0
170
Member Avatar for Anon17

[code] #include <iostream> #include <string> using namespace std; int main() { string str = "Hello*World"; str.replace(5,1,"%2A"); cout << str << "\n"; } [/code]

Member Avatar for Ancient Dragon
0
100
Member Avatar for rwagnes

go to [url]www.codeprject.com[/url] and search for tab control examples. They have a lot of mfc code that you can look at to see how its done.

Member Avatar for Salem
0
408
Member Avatar for medopunsher

I think what you want is an ftp library -- [URL="http://www.google.com/search?source=ig&hl=en&rlz=1G1GGLQ_ENUS328&=&q=c%2B%2B+ftp+library&aq=0&oq=c%2B%2B+ftp+&aqi=g10"]here are some links[/URL].

Member Avatar for Ancient Dragon
0
225
Member Avatar for daviddoria

I suggested that same thing a few months or a year ago but was boldly ignored. Dani is not amiable to creating new forums for whatever reason.

Member Avatar for NicAx64
0
204
Member Avatar for jessejamesjjr

>>was hoping u or some one wood direct me to a specific scource.... since were in C++ forum There is no specific source. Modular programming is a concept, not something you can show and say "well that's it.". If you really googled like previously suggested then the very first link …

Member Avatar for ahmadabdullah
0
131
Member Avatar for inanc

[URL="http://support.ipswitch.com/kb/WSK-19980709-EM01.htm"]winsock error 10061[/URL]

Member Avatar for serup
0
317
Member Avatar for wingers1290
Member Avatar for jko2326

[URL="http://www.google.com/search?source=ig&hl=en&rlz=1G1GGLQ_ENUS328&=&q=ascii+table&aq=0&oq=ascii+&aqi=g10"]Here [/URL]are a few tables that will show the ascii codes for all possible values. Note that decimal values 0 thru 32 are not printable so you won't see anything on your screen for them. Only values 33 thru 126 can be shown on the screen.

Member Avatar for VernonDozier
0
322
Member Avatar for Creator07

Install the [URL="http://www.microsoft.com/downloads/details.aspx?FamilyID=9b2da534-3e03-4391-8a4d-074b9f2bc1bf&displaylang=en"]Redistributables [/URL]and your program should be ok. Also read [URL="http://msdn.microsoft.com/en-us/library/zebw5zk9.aspx"]this article[/URL] carefully.

Member Avatar for Creator07
0
199
Member Avatar for dub4theworld

Try this. GetNext() simply returns NULL and that is not what you want. [code] void Lobby::AddPlayer() { //create a new player node cout << "Please enter the name of the new player: "; string name; cin >> name; Player* pNewPlayer = new Player(name); //if list is empty, make head of …

Member Avatar for dub4theworld
1
88
Member Avatar for brc6523

[URL="http://download.microsoft.com/documents/useterms/Windows%20XP_Professional_English_9e8a2f82-c320-4301-869f-839a853868a1.pdf"][quote="Microsoft Enduser License Agreement"]Installation and use. You may install, use, access, display and run one copy of the Product on a single computer, such as a workstation, terminal or other device (“Workstation Computer”). The Product may not be used by more than two (2) processors at any one time on …

Member Avatar for PCmania
0
487
Member Avatar for b89smith

If all you want to do is download a file then [URL="http://msdn.microsoft.com/en-us/library/ms775123%28VS.85%29.aspx"]this is the function for you[/URL]. Also see[URL="http://www.daniweb.com/forums/post930586.html"] this thread[/URL].

Member Avatar for Ancient Dragon
0
113
Member Avatar for XodoX

Second problem: look up in your textbook about Pure Virtual classes and functions. Third problem: 1. pulblic: -- mispelled 2. Shape needs a default constructor (one with no parameters)

Member Avatar for Ancient Dragon
0
81
Member Avatar for Mushy-pea

>>Sure, it might feel harder in the short term, but I think we would reap the benefits eventually And just what are the benefits of communism? I haven't seen any around the world, such as in China and Cuba. All I see in communist countries is grief, sorrow, and enslaved …

Member Avatar for Chaky
0
156
Member Avatar for kz07
Member Avatar for SeeTheLite
0
110
Member Avatar for br99

[QUOTE=br99;929548]I'm trying to write a GUI program where I want to use both strings and vectors, but the computer won't recognize them no matter where I try to include <string> and <vector>. Can you tell me where in the code I need to put my includes and my std namespace?[/QUOTE] …

Member Avatar for br99
0
551
Member Avatar for betheey

I don't know what you mean by "helping yourself" and "security part" of DaniWeb. I don't think we have anything like that.

Member Avatar for happygeek
0
102
Member Avatar for dannz89

Observation: string.h is a standard C header file -- rename yours to something else to avoid filename clashes. In MS-Windows file names are not case sensitive like they are in *nix, so String.h is the same file as string.h, which is clearly not what you want because your program is …

Member Avatar for dannz89
1
150
Member Avatar for serkan sendur

Serkan: your whole problem is that you need to get yourself a nice woman to satisfy your lustful desires. One who can relate to you both body and mind, not someone just in virtual computerland. Get married, have a few kids. But stop that kickboxing, it ain't healthy for you …

Member Avatar for ~s.o.s~
0
383
Member Avatar for mcco1
Member Avatar for zautner
0
122
Member Avatar for The Dude

The only reason I buy it is so that I can have it where I work. Otherwise at home my refrigerator has a cold water filtered facet that is quite cheep to operate. The bottled water that I buy costs about $0.12/20-oz bottle, or about $0.75/gallon. If you are paying …

Member Avatar for MosaicFuneral
0
141
Member Avatar for bethennyengland

No, I think he's asking how a business can profit by providing open-source software. I know that Red Hat Linex maked their money on technical support and customizations. Similar with MySQL.

Member Avatar for Ancient Dragon
0
74
Member Avatar for rahim_rasimin

Use either [URL="http://www.google.com/search?source=ig&hl=en&rlz=1G1GGLQ_ENUS328&=&q=odbc+c%2B%2B+tutorial&aq=0&oq=odbc+c%2B%2B&aqi=g8"]ODBC[/URL] or [URL="http://www.google.com/search?hl=en&rlz=1G1GGLQ_ENUS328&q=ado+c%2B%2B+tutorial&aq=f&oq=&aqi="]ADO[/URL] in c++ programs. Neither are for the faint of heart and require a firm grasp of c or c++ fundamentals. Microsoft's MFC class also has a database class. Once you have the query, I'd put the query contents in a [icode]vector< vector<string>>[/icode] object, assuming all …

Member Avatar for Ancient Dragon
0
135
Member Avatar for vegaseat

Oh you people complain about a few minutes boot time! You should work with mainframe computers which can take several hours to boot. Of course I realize you don't have mainframe computers on your laptops :) I've been using Vista Home Premium for a couple years now and have grown …

Member Avatar for kaninelupus
0
637
Member Avatar for 23.12.2012

Here is another way to do it since the requirement is to use <vector> class. [code] #include <stdio.h> #include <iostream> #include <vector> #include <iomanip> using namespace std; int main() { vector<float> ay; for(float i = 0.0F; i < 1.0F; i += 0.1F) ay.push_back(i); vector<float>::iterator it = ay.begin(); for( ; it …

Member Avatar for 23.12.2012
1
214
Member Avatar for bubblellicious

[code] int distance = 0; char str[] = "Hello World"; char *ptr = strstr("World"); if( ptr != NULL) distance = ptr - str; [/code]

Member Avatar for Dream2code
0
101
Member Avatar for DavidJ12345

A program that runs on the development computer but not on other computers normally indicates there are one or more missing DLLs on the computer that it don't run on. And that is usually because the program was compiled for debug, not release. Recompile both the application and DLL for …

Member Avatar for DavidJ12345
0
106
Member Avatar for duka96

m_pointVar has to be a pointer for that to work. If it isn't, then how to check will depend on the class. Make the class constructor initialize all its variables and the program user won't have to worry about whether it was initialized or not. Testing for NULL pointer will …

Member Avatar for duka96
0
110
Member Avatar for metdos

I've found that some compilers don't care whether you put in quotes or angle brackets. I personally like using the quotes to make it easier to distinguish compiler standard headers from others.

Member Avatar for metdos
0
177
Member Avatar for arice

Welcome to DaniWeb. There is lots of posts here for you to help. And yes, we don't do people's homework for them either.

Member Avatar for semoweb
0
158
Member Avatar for waqarafridi

In C language the fgets() function will trim leading and trailing spaces from words read. It will also skip over '\n'. Text files do not contain '\0' bytes; if your file does then it is not a text file.

Member Avatar for Dream2code
-1
153
Member Avatar for walter clark

>>what do I change to see a different name at the top? Are you concerned with the version of the compiler (e.g. VC++ 2005 or VC++ 2008) or the version of the program? -is duplicating folders the best method for making new versions? IMO -- yes. The released version of …

Member Avatar for walter clark
0
93
Member Avatar for slatk3y

The first parameter needs to be a reference or pointer to a pointer. All that function is doing now is changing its own local copy of the pointer. Suggest either of these changes: [icode]void double_array_1d(int** arr, int length)[/icode] or this [icode]void double_array_1d(int*& arr, int length)[/icode] If you use the first …

Member Avatar for slatk3y
0
106
Member Avatar for prasexclusive

Welcome to DaniWeb. Just how "elderly" are you anyway? If you are over 100 you might have problems learning to program :) Where to learn depends on the programming language. But we can discuss that more in [URL="http://www.daniweb.com/forums/forum5.html"]DaniWeb IT Professionals' Lounge[/URL].

Member Avatar for Ancient Dragon
0
5
Member Avatar for headedtomexico

>>so it just bogs the shit out of the game..... anyone have any ideas on this? Yes I know. Database access is always slow. Maybe you need to shove the database access code in another thread so that it doesn't affect the game. And your problem will only get worse …

Member Avatar for Ancient Dragon
0
105
Member Avatar for huzeifa

[URL="http://msdn.microsoft.com/en-us/library/bb775941%28VS.85%29.aspx"]Read this[/URL] -- send WM_ENABLE message to the button.

Member Avatar for Ancient Dragon
0
91
Member Avatar for Yaserk88

you could use getline() with the third parameter [code] string word; while( getline(infile, word, ';' ) { cout << word << "\n"; } [/code]

Member Avatar for Ancient Dragon
0
4K
Member Avatar for AssaultM16

std::string's find() method then use std::string's substr() method to extract the string. IMO its better than strtok() because it doesn't modify the original string. If you were using c++/CLR then it's String class has a Split() method, but that isn't standard c++ and works only with Microsoft compilers.

Member Avatar for AssaultM16
0
157
Member Avatar for Uttumi

The new c++ standards, which will not be released for some time yet, is supposed to allow arrays to be allocated like that: [icode]int ay[size][/icode] where size is not a const integer. A few compilers may already support it, but if they do it is compiler-specifc.

Member Avatar for John A
0
243
Member Avatar for Bertie

You mean you want help on how to keep your team members happy and still be able to develop the DLL? >>do you define an interface, then write the implementation to a DLL, then pass the DLL around, then. Basically, yes that's the way to do it. But it doesn't …

Member Avatar for Bertie
0
81
Member Avatar for gispe

>>First time I compiled it with MicrosoftC++ and gave me just 1 error, that corrected You should have tried to compile it again with that compiler. I used VC++ 2008 Express and the code you posted had billions of error messages. There are indeed several errors. 1) struct art -- …

Member Avatar for losh177
0
141
Member Avatar for ss2602
Member Avatar for m_amin

Look in the directory in which the project is store -- the name of the header file is most likely Form1.h. >>Also i want to access its controls for updating. Don't know.

Member Avatar for kvprajapati
0
459
Member Avatar for kevintse

I don't know a thing about Chinese characters, but I would suggest reading the file 2 bytes at a time. After reading 2 bytes test to see if it is a valid Chinese character. If not, assume its two ascii characters. Then write out either the chinese characters (which are …

Member Avatar for Ancient Dragon
0
139
Member Avatar for maestermoo
Member Avatar for Ancient Dragon
0
135
Member Avatar for Creator07

Maybe you should use a check button. Or search t[URL="http://www.codeproject.com/KB/buttons/"]hese links[/URL] for something similar to what you are looking for. codeproject.com has a wealth of MFC and other code.

Member Avatar for Creator07
0
177
Member Avatar for jephthah

[QUOTE=jbennet;921465]Happygeek and Dani have the same powers as a global mod already.[/QUOTE] Actually they have powers way beyond that of a SMod.

Member Avatar for shadwickman
0
204
Member Avatar for scru
Member Avatar for ~s.o.s~
1
527
Member Avatar for xiikryssiix
Member Avatar for xiikryssiix
0
118

The End.