15,300 Posted Topics

Member Avatar for Tony_Gee
Member Avatar for november_pooh
0
146
Member Avatar for CoolGamer48

>>Is the parameter like a refrence to another function Yes -- it is a pointer to another function. The function can be either a normal global function or a static method of a class and must take parameters as prototyped in that line. example: [code] void foo(Type** resource, char*name, char*path) …

Member Avatar for Salem
0
93
Member Avatar for roachic

getcwd() will return the full path to the current folder. Or ".\\myfile.txt" or "./myfile.txt"

Member Avatar for roachic
0
97
Member Avatar for The Dude

That's one of the best commercials I've seen in a long long time :) But I live in Budweiser country.

Member Avatar for Ancient Dragon
0
41
Member Avatar for Trckst3

line 49: for your own sanity and the benefit of others who must read and understand your program put those } braces on separate lines and in line with the opening {. Don't be afraid to make liberal use of white space in your code.

Member Avatar for ivailosp
0
100
Member Avatar for kiwihaha

>>what can i do with c++???? You can use vector instead of arrays. line 5: should be <string> to get std::string class line 24: use [b]int main()[/b] line 129: you need to make that function return a value if the loop never finds what it is looking for. Spell out …

Member Avatar for Ancient Dragon
0
99
Member Avatar for Arne Kristoffer

line 11: you don't do it like that. use single quotes to compare characters [icode]if (str[x] == 'a') [/icode] [edit]^^^ like he said[/edit]

Member Avatar for Arne Kristoffer
0
22K
Member Avatar for ulrik04

I don't know the answer to your question but there's got to be a much simplier way to code that switch statement. What are you going to do if someone wants to be a level 255? Lets see -- 20 lines of code for level 2 I guess will mean …

Member Avatar for ulrik04
0
111
Member Avatar for nurulshidanoni

read [URL="http://www.google.com/search?hl=en&q=c%2B%2B+sort+algorithms&btnG=Search"]these google links[/URL].

Member Avatar for Ancient Dragon
0
112
Member Avatar for kpnprakash

>>Can anyone help me that how to develop the codes. Sure thing -- start here [code] #include <stdio.h> int main() { // put your code here } [/code]

Member Avatar for Ancient Dragon
0
132
Member Avatar for bswapnil

fgets() appends the '\n' to the end of the string, so you have to truncate it before you can use fname to open the file [code] fgets(fname ...); if( fname[strlen(fname)-1] == '\n') fname[strlen(fname)-1] = 0; [/code] line 36: The answer to your question can be done a couple ways. I …

Member Avatar for Ancient Dragon
0
132
Member Avatar for majestic0110

Do you remember the TV miniseries [b]V[/b] ? That's my idea of what aliens would be like. They come to Earth to harvest its human population for food.

Member Avatar for Anonymous86
0
102
Member Avatar for Race

what part(s) of that do you know how to write? Break the problem down into smaller parts and it will be a lot easier for you to write. For example: to start off "Write a c++ program". To that much first by just writing the shell of main(). "reads from …

Member Avatar for Race
0
76
Member Avatar for iiz

you will have to do that in several lines. [URL="http://opengroup.org/onlinepubs/007908775/xsh/popen.html"]popen()[/URL] [URL="http://www.opengroup.org/onlinepubs/009695399/functions/getcwd.html"]getcwd()[/URL] [code] #include <stdio.h> int main() { char path[255] = {0}; char command[320] = {0}; strcpy(path, getcwd()); strcpy(command, "explorer.exe "); strcat(command, path); FILE* fp = popen( command, "r" ); // now read from the file pointer just as you would …

Member Avatar for iiz
0
98
Member Avatar for The Dude

Maybe that car was almost out of gas and he was rushing to the next gas station that's about 100 miles away :)

Member Avatar for The Dude
0
38
Member Avatar for GPXtC02

that is a template and works with strings as well as integers. [code]int main() { string a = "Hello"; string b = "World"; swap(a,b); cout << a << " " << b << "\n"; return 0; } [/code]

Member Avatar for GPXtC02
0
262
Member Avatar for kommuru

Welcome to DaniWeb. When you think you have most of it done post a link to it in Website Reviews and people will make comments.

Member Avatar for zandiago
0
104
Member Avatar for rem0404

you need to pass [b]numElements[/b] by reference in addMessage() function just like you did in load().

Member Avatar for rem0404
0
162
Member Avatar for Troula

are the user names and passwords in two different files ??? Normally they would be in the same file and on the same line. such as [icode]troula mypassword[/icode]

Member Avatar for Narue
0
111
Member Avatar for rzr.copperhead

when posting that much code you need to post all of it so that it will compile cleanly (unless that's the problem). main.cpp does not contain the include files and class Medicane is undefined.

Member Avatar for Ancient Dragon
0
202
Member Avatar for _Nestor

you don't need to use the Replace method -- just simply index into the array [code] int i = 0; int len = m_VideoName.GetLength(); while( i < len ) { while(i < len && isspace( m_VideoName[i] ) && ispunct(m_VideoName[i])) ++i; if( i < len ) m_VideoName[i] = toupper(m_VideoName[i]); } [/code]

Member Avatar for _Nestor
0
100
Member Avatar for lizhiyuan

do you mean the difference between [icode]void foo(int *array)[/icode] and [icode]void foo(int array[]);[/icode] ?? The difference: nothing. They are identical, just two different ways of saying the same thing.

Member Avatar for Ancient Dragon
0
114
Member Avatar for TheBeast32

Several ways [list] [*]save values to a file on program exit and read on program start [*]save values in the registry [*]save values in the program *.exe file [/list] All you really need to do is save the installation date in a hidden file somewhere then read it each time …

Member Avatar for TheBeast32
0
142
Member Avatar for dgg32
Member Avatar for rzr.copperhead

>> file.write((char*)&(*newVecService[i]), sizeof(*newVecService[i])); try this: [icode] file.write((char*)newVecService[i], sizeof(*newVecService[i]));[/icode] newVecService[i] is alread a pointer -- no need for all that typecasting. >>void saveFile(vector<Service*> newVecService) pass the vector by reference to avoid duplicating the vector [icode]void saveFile(vector<Service*>& newVecService)[/icode] >>Service *newServ; >>vector<Service*> vecService(300,newServ); You are initializing each of the 300 vector elements with …

Member Avatar for rzr.copperhead
0
120
Member Avatar for wakeup

your are right and there is nothing you can do about it because of the way floats and doubles are stored in memory. wikipedia has a [URL="http://en.wikipedia.org/wiki/Floating_point"]good article about that[/URL]

Member Avatar for White-Gandalf
0
114
Member Avatar for Muttley

What compiler are you using that produces the error? There is nothing wrong with that header file. You don't need to typedef that struct in C++ because structs are almost identical to classes. So all you need is this: [code] struct VE {int maxnr; int n; int *a; }; [/code]

Member Avatar for Muttley
0
141
Member Avatar for vaid.abhishek

line 44: you need to include <ctime> Otherwise this is what I get. Is it right or wrong? I'm not certain what your code is trying to do but from the looks of the output it looks like you are trying to sort the array [quote] Array before Partitioning(20) -> …

Member Avatar for Ancient Dragon
0
296
Member Avatar for timberland26

Its hard to believe that any teacher would give that assignment in a Programming 101 type into class. You would probably have to write some sort of pattern recognition program, which is highly specialized and advanced type of programming. Not something that a newbe, or many oldtimers, could tackle. Sounds …

Member Avatar for Nick Evan
0
291
Member Avatar for roachic

>>Oh btw, can someone also explain what this is 'srand ( time(NULL) );'. I read that I have to use it for some reason but I'm not too sure srand() seeds the random number generator so that it will generate a different set of random numbers every time you run …

Member Avatar for roachic
0
199
Member Avatar for Suraine

>>Is that possible Yes it is, in fact its common for large programs to have hundreds of *.cpp files. >>How can I achieve that? The most common way is to create a header file and include it in each of the *.cpp files [code] // myfile.h header file extern void …

Member Avatar for Suraine
0
120
Member Avatar for tones1986

You can't do this because too many parameters `ofstream& operator<<(ofstream& out, float *p, int arraySize)` But you can put that pointer into a structure and make the operator output the struct struct arr { float* p; int arraySize; }; ofstream& operator<<(ofstream& out, struct arr* p) { }

Member Avatar for Ancient Dragon
0
139
Member Avatar for guest7

fin.seekp(ios::begin) fin.clear(); >>Hope you have tried... SeekTobegin() That is only for MFC CFile class. Not available to anything else.

Member Avatar for Ancient Dragon
0
93
Member Avatar for metropolisiii

You can write DLLs or shared libraries that extend the functionality of a program, but beyone that the answer to your question is NO because C and C++ are not interpreted languages.

Member Avatar for Ancient Dragon
0
56
Member Avatar for ramiljoaquin

No special compiler needed. What you need is to use ODBC (there are other ways that are more specific to the database, but ODBC is common to them all) google [URL="http://www.google.com/search?hl=en&q=ODBC+c%2B%2B+classes"]ODBC c++ classes[/URL] and you will find several free ones. I'd also suggest you read some [URL="http://www.google.com/search?hl=en&q=ODBC+tutorial"]ODBC tutorials[/URL] and [URL="http://www.google.com/search?hl=en&q=SQL+tutorial&btnG=Search"]SQL …

Member Avatar for ramiljoaquin
0
99
Member Avatar for Rand22

>>while(!inFile.eof()) wrong way to code that loop [icode]while( getline(inFile, title) )[/icode]

Member Avatar for Ancient Dragon
0
715
Member Avatar for lizhiyuan

[b]private[/b] variables can only be accessed by the class . [code] class A { private: int x; public: void SetX(int n) { x = n; } // <<< this is ok }; int main() { A aobj; aobj.x = 0; // << error because not inside the class } [/code] …

Member Avatar for Ancient Dragon
0
218
Member Avatar for daviddoria
Member Avatar for Drixoman
Member Avatar for jbennet
0
48
Member Avatar for Little E

>>sent[num]; what you should do here us use strcpy() to copy the first random string into sent variable, then strcat() to copy each of the other strings. >>printf("\n\n%s %s %s %s %s %s.\n\n", a[i], n[i], v[i], p[i], a2[i], n2[i]); variable i is not a random number. you should use variable …

Member Avatar for CPLUSCPLUS
0
535
Member Avatar for annapink

So what have you done for the past two weeks other than stare at the requiremeents in disbelief ? Have you actually attempted to write those two classes ? Have you studied your textbook and listened to your teacher's lectures? I know that every textbook ever written about c++ will …

Member Avatar for VernonDozier
0
111
Member Avatar for Carwy

[QUOTE=Carwy;573618]Well lets see this is my second semester of school. How long did you have to become an ass?[/QUOTE] If you cant' take the heat then get out of the kitchen. Second semester student is very good, but after you graduate and get your first job you will only begin …

Member Avatar for Salem
0
447
Member Avatar for fallen_prisoner

Another suggestion is replace the character array with std::string and you can keep those == comparison operators because std::string permits them.

Member Avatar for Ancient Dragon
0
115
Member Avatar for jmines

This is no such concept as multi-line strings. If you want CR/LF in the string then just append "\n" whereever you want a new line to begin when output [code] std::string hello = "Hello\nWorld\n"; cout << hello; [/code]

Member Avatar for jmines
0
90
Member Avatar for k2k

classes/structs must be terminated with a semicolon, which is missing at the end of hourlyEmployee_h

Member Avatar for Ancient Dragon
0
130
Member Avatar for richasr1

You have to find out where [b]frm1[/b] is declared. Is it a member of a class in which the code snippet you posted resides? Look in the *.h files and see where that variable is declared. Or is it even in a header file.

Member Avatar for richasr1
0
362
Member Avatar for Ints

>> whoever is hanging on to that crap is not likely to shell out much cash for new program >>development on what is probably a maintenance money sink as it is I know of several manufacturing companies that are still using it on the assembly lines. Why? Because it is …

Member Avatar for jephthah
0
133
Member Avatar for roachic

>>Is the only around this to use arrays? Or linked lists -- yes. I would think something like below will work. You will probably want to declare the pointer in the class header file instead of the *.cpp file as shown below so that it doesn't disappear when the function …

Member Avatar for roachic
0
116
Member Avatar for bbfree

I think you are asking when you add a string to the combo box the currently selected string becomes unselected causing ItemIndex to be invalidated ? If that is true then you will want to save the currently selected string in a local variable in your function, add the string, …

Member Avatar for Ancient Dragon
0
75
Member Avatar for ElectorCount

>>i did not want to ressurect old threads. Good -- you might have teen tounglashed had you done that :) Write a function that keeps track of all the random numbers it creates. Put the numbers into an array then each time a number is generated search the array to …

Member Avatar for VernonDozier
0
337

The End.