193 Posted Topics

Member Avatar for JONZ

Perhaps this may help ? [URL="http://en.wikipedia.org/wiki/Wikipedia:Algorithms_on_Wikipedia"]here[/URL] :)

Member Avatar for rpiper138
0
175
Member Avatar for abcd_nima

There are a several ways to return a string to a calling function. You can use char* or the C++ string class. I would recommend: [icode] int foo(char* myString){ strcpy(myString,"www"); return 0; }[/icode] [icode] int foo(string& myString){ myString = "www"; return 0; } [/icode] You can also do [icode] char* …

Member Avatar for ArkM
0
118
Member Avatar for Clipper34

What Operating System are you on ? If you are on Unix or Linux then look up the kill() system call [URL="http://www.opengroup.org/onlinepubs/009695399/functions/kill.html"]here[/URL]

Member Avatar for Ancient Dragon
0
202
Member Avatar for JackDurden

The getline function for the istream class returns the line in a char[] istream& getline (char* s, streamsize n ); istream& getline (char* s, streamsize n, char delim ); There is another getline for the string class which returns the array in a string. istream& getline( istream& is, string& s, …

Member Avatar for Ancient Dragon
0
506
Member Avatar for MylesDBaker

Firstly the line feed or the new line character is '\n' not '/n'. By default most records in a file on Windows are terminated by the CRLF (\r\n) ie, the carriage return and line feed. On *nix, its just the LF (line feed character) '\n'. If you are uploading both …

Member Avatar for MylesDBaker
0
152
Member Avatar for Avaleriona

well your main function should be [icode] int main(){ return 0; } [/icode] Also EOF is a reserved macro. So call yours something else like "NEWLINE" or such.

Member Avatar for Narue
0
173
Member Avatar for Hinche4

One of your issues is that your variables are static. So the scope of the variable is at a class level, not at an object level. Hence you will probably need to initialize it outside your constructor. In order to access a static variable, at the class level using the …

Member Avatar for ArkM
0
311
Member Avatar for Jennifer84

See [URL="http://www.cppreference.com/wiki/stl/algorithm/max_element"]http://www.cppreference.com/wiki/stl/algorithm/max_element[/URL]

Member Avatar for stilllearning
0
141
Member Avatar for shinta13

Your tax rate for each year will be something like: YearlyTaxRate = intial_cost * tax_rate; Your current code states [icode] tax_rate = ? * initial_cost; total = initial_cost + electric_bill + water_sewer + tax_rate; [/icode] tax_rate is the variable where you are storing the user input. So define another variable …

Member Avatar for stilllearning
0
102
Member Avatar for IrishUpstart

You will need to save the atomic weights for each element. For instance double OxygenAtom = 15.994 Then compute the total atomic weight for each element depending on the number of atoms, and then the average. double TotalOxygenAtomWeight = OxygenAtom * O Then compute TotalAtomicWeight and TotalNumberofAtoms. Your average weight …

Member Avatar for stilllearning
0
652
Member Avatar for flipjoebanana

You open your input file. Read it until the end of the file. Close it. Set file pointer to stdin and keep reading until the user inputs exit. They are two separate input sources and have to be handled one after the other. Batch File description [URL="http://en.wikipedia.org/wiki/Batch_file"]here[/URL]

Member Avatar for flipjoebanana
0
161
Member Avatar for ballinloughan
Member Avatar for PaladinHammer

You need an array that will store both your total quantity and the corresponding total price for that quantity. You have 5 items in all and each item has a total quantity and a total price. Edit: My mistake earlier. Your qty is an int and your price is a …

Member Avatar for stilllearning
0
177
Member Avatar for jrrr

I don't get it .... Why are you overwriting your password with the clue in change() ? [icode] strcpy(password,clue); [/icode] and why are you calling compare() from change even when the user does not enter a password .. coz then you have nothing to compare really ?

Member Avatar for stilllearning
0
88
Member Avatar for sunveer
Member Avatar for babiker

FYI .. void main() is never to be used ! It should [B][I]always[/I][/B] be [CODE] int main(){ return 0; } [/CODE] See [URL="http://users.aber.ac.uk/auj/voidmain.shtml"]here[/URL]

Member Avatar for ArkM
0
98
Member Avatar for swbuko

It looks like pseudocode. You really want to translate this into C++ , write the whole program and see what you get.

Member Avatar for stilllearning
0
236
Member Avatar for welles

I am not so sure that its a good idea to in terms of OO to do this, but here goes .. Basically what you want is to add a function say void ChangeNumber(int index, int value) to your base class, where index is the position in the vector and …

Member Avatar for stilllearning
0
97
Member Avatar for eehyf

Basically you will compare the strings character by character. So start with comparing "A" to "J", since J is higher up than A, "John" is lexicographically larger.

Member Avatar for grumpier
0
154
Member Avatar for eehyf

Here is your prototype for getName: char* getName() { return name; } So you need : temp = currnode->contact->getName();

Member Avatar for eehyf
0
192
Member Avatar for Majestics

Have you looked at the function fcvt ... see [URL="http://linux.about.com/library/cmd/blcmdl3_fcvt.htm"]here[/URL]. On windows its _fcvt_s [URL="http://msdn.microsoft.com/en-us/library/ty40w2f3(VS.80).aspx"]here[/URL] And you can always use sprintf .. its slower but reliable.

Member Avatar for stilllearning
0
2K
Member Avatar for shamila08

Ok, first of all ... you CANNOT define your main function this way. Read [URL="http://en.wikipedia.org/wiki/Main_function_(programming)"]this[/URL]. Its either [icode] int main(){ return 0; } [/icode] or [icode] int main(int argc, char* argv[]){ return 0; } [/icode] You need to allocate space to your int array Value and then pass it in. …

Member Avatar for stilllearning
0
108
Member Avatar for coolcampers

If you did the ftp in ASCII mode, your \r\n would be converted to \n on *nix. Another option to do it, if your file is not really large is just open the file in vi and then do a global search and replace by typing ":%s/Ctrl-VM//g" The Ctrl-V gives …

Member Avatar for Narue
0
2K
Member Avatar for inim38

Please post some code so that we can see what you have worked on until now. Check the forum rules [URL="http://www.daniweb.com/forums/announcement8-2.html"]here[/URL] Also [URL="http://www.mattjustice.com/cnotes/c_fileio.html"]here[/URL] is a C File I/O tutorial to help you get started.

Member Avatar for inim38
0
120
Member Avatar for kimn

You might need to clear any set flags before you try to use the same file pointer "conFile" to access the second file. ie [CODE] if (!conFile){ conFile.clear(); conFile.open("code/constants.h", ios::in); } [/CODE]

Member Avatar for kimn
0
59
Member Avatar for daviddoria

You should open the file as ios::binary. There is really no way to directly read in bits. You have to read in the bytes and then write a function to read the bits from a byte.

Member Avatar for Narue
0
125
Member Avatar for Sarav01

hmm .. please read [URL="http://www.daniweb.com/forums/announcement8-2.html"]this[/URL]

Member Avatar for Sarav01
0
296
Member Avatar for jkuboschek

You could use char** as the return type, and pass in an integer pointer that will hold the total number of strings that you return to the calling function. for example: [code] char** foo (int* nStrings, ....) [/code]

Member Avatar for jkuboschek
0
161
Member Avatar for mark0420

The shell is basically a program that takes your keyboard input, usually at a command prompt and gives it to the operating system to process it. You can also put shell commands into a file and execute it using "sh filename". There are different types of shells csh, ksh, bash. …

Member Avatar for subnet0
0
99
Member Avatar for stilllearning

Hi, I am trying to find the header file monetary.h and the function strfmon() to do some currency conversions, but Visual Studio 2005 compiler doesn't seem to support those. Does anyone know if there is an alternative function I can use ? Thanks a lot.

Member Avatar for ssharish2005
0
220
Member Avatar for talulinator

You should be able to find a job in software development with a Masters in CS. I've understood over the the period of my education that it helps to try and get your first job through campus interviews because that is the easiest way and that is the only way …

Member Avatar for kramero
0
143
Member Avatar for arjayes

One way to do it, also assuming know how many instances of it you want to run, is in a loop, start the process in the background. [CODE]while (x < counter){ ./process& x++; }[/CODE]

Member Avatar for arjayes
0
77
Member Avatar for guitarrick

Hmm, I think the problem may be that your class definition is missing a ";" at the end.

Member Avatar for guitarrick
0
114
Member Avatar for edouard89

The AIX native C compiler does not like the // comment style for .c files, since its considers it a C++ comment and not a C style comment. I think that is probably the reason you're getting the errors and you will either need to change it to the /* …

Member Avatar for edouard89
0
154
Member Avatar for np2100

I think you need to put braces around your if statements. Otherwise its always going to read in the eurosdollars variable. Its a good practice put braces around the body of the condition, even if its one line. [CODE] if (currency==1){ cout<<"Please enter the Dollars you would like to convert …

Member Avatar for np2100
0
309
Member Avatar for stilllearning

Hello, I looked for this on the forums, and found an invalid link to a tutorial. But I'd appreciate it very much if someone can point me to a tutorial on hash tables, that includes a basic implementation in C or C++. Thanks a lot.

Member Avatar for stilllearning
0
150
Member Avatar for matt nagel

I am not sure if this is needed or not, but most CSV files have a header record, which is essentially the names of the columns separated by commas. If you are parsing an actual CSV file, you will need to take that into account also.

Member Avatar for Duoas
0
7K
Member Avatar for sanjay goyan

With bash if you are typing on the command line you can just type $ expr 2 + 4 6 If you are putting it in a file, you can do #! /bin/bash expr 2 + 4 var=`expr 2 + 4` echo $var and it will print: 6 6

Member Avatar for masijade
0
106
Member Avatar for everlast

This is a basic bash scripting tutorial [URL="http://www.linuxcommand.org/writing_shell_scripts.php"]http://www.linuxcommand.org/writing_shell_scripts.php[/URL] I found which is quite helpful, and takes you through simple scripting step by step. This explains shell commands and how to write simple scripts. I would also recommend a tutorial on regular expressions if you are not familiar with those, since …

Member Avatar for everlast
0
79
Member Avatar for noamb

This is interesting, and I was able to solve it using a couple of passes with pipes. For me its just easier to break it up into the steps that you explained and go through them one by one, and use temp files if needed. You can use a combination …

Member Avatar for stilllearning
0
84
Member Avatar for stilllearning

Hello, I need to figure out the sizes of different data types in a bash script. I haven't been able to make it work with sizeof(), is there an alternative ? Thanks a lot.

0
76
Member Avatar for warpstar

The scanf() function is defined correctly. scanf basically is used to read input from stdin according to the format specified. The format can consist of control characters which are %d %s %f and so forth. All control characters must be preceeded by a % in both printf and scanf. The …

Member Avatar for Salem
0
486
Member Avatar for stilllearning

Hi Everyone, I just wanted to introduce myself. I am a sw developer, work mostly with C, but there is so much that I still don't know ... hence the name :) . I came across DaniWeb while trying to learn how to do time complexity of algorithms. Its been …

Member Avatar for jasimp
0
46

The End.