15,300 Posted Topics
Re: >>is it a standard one? Yes -- all compilers are required to implement it like that. [URL="http://en.wikipedia.org/wiki/ANSI_C"]Here[/URL] is info about [b]ansi c standards[/b] >>the array name cannot be changed is it the standard or compiler dependent. Standard -- its impossible to change the name of an object once it has … | |
Re: It should exchange the value of the two variable parameters. The two parameters are [URL="http://www.brpreiss.com/books/opus4/html/page593.html"]passed by reference[/URL] so that swap() can change them and the calling function will see the change. | |
Re: line 9: string stop, flavor, count = 0 count is a string, so why are you setting it to 0 like it is an integer? I suspect you want this: [icode]int count = 0;[/icode] line 26: >> if (flavor = 'STOP' || 'stop') strings have to be enlosed in double … | |
Re: 1) remove conio.h -- its non'standard and not implemented by very many compilers. Code snippets should not use compiler-specific stuff. 2) delete all those global variables on lines 12 and 13. Just declare them inside the functions that use them. And you will probably have to pass the std* head … | |
Re: where is your code? No one here will write that program for you. | |
Re: better off replacing that fprintf() with c++ fstream class so that the compiler won't complain so much. | |
Re: >>The program is supposed to take in a file provided through standard input That means get the name of the file from standard input, not the lines of the file. You have to open the file and read each word, something like this: [code] int main(int argc, char* argv[]) { … | |
Re: You don't have to store all the lines, just the two lines that you want to compare. Sequentially read the file, counting lines as you go along then save only the two lines you want to compare. | |
Re: [QUOTE=joshSCH;461509]Aside from your atrocious spelling, and absolute terrible writing ability[/QUOTE] I doubt English is his native language. You try writing in a language you don't know very well and you too will have that exact same problem. DaniWeb does not require people to be English majors or native English speakers. … | |
Re: Its really a very simple concept ([URL="http://www.newtonlabs.com/ic/ic_6.html#SEC40"]link here[/URL]) | |
Re: >>mysql_result[3000][2]=msq_row; If you programmed the rest of that then you should probably know that the above like doesn't work. You should be reading [URL="http://www.zetcode.com/tutorials/mysqlcapitutorial/"]this tutorial[/URL]. (scroll down to the section [b]Retrieving data from the database[/b]) | |
![]() | Re: Deposit $10,000.00 USD in my paypal account and I'll do it for you. Otherwise you will just have to write the program yourself. ![]() |
Re: Why did you make grades a double instead of an integer? doubles are not necessary in your program because nobody will have a grade of something like 75.123 (at least I never heard of such a thing). First thing is to make a function that takes two arrays as arguments … | |
Re: >>i am ne wto ruby on rails,plzz what in the world does that mean :eek: :eek: Looks like half English and half Gibberish. | |
Re: If you use string, then use find() to locate the space, and substr() to extract the characters from position 0 to the location returned by find(). | |
Re: >>The program was initially written in VC++ VC++ is not a computer language. Its an IDE/compiler. So saying you are converting from vc++ to c++ is nonsense. | |
Re: Is a core file produced? Yes, then use dbg on that core file and it will tell you where the crash occurred. | |
Re: [URL="http://dinosaur.compilertools.net/yacc/index.html"]Yet Another Compiler Compiler (YACC)[/URL] | |
Re: Modern 32-bit compilers to not support that header file because it was intended for 16-bit MS-DOS 6.X and earlier operating systems. The alternative is to use win32 api functions OpenFile() to open a comm port, ReadFile() and WriteFile() to read/write to it. MSDN has a large article about [URL="http://msdn.microsoft.com/en-us/library/ms810467.aspx"]serial communications.[/URL] | |
Re: Happy Birthday Dani. I'm having an extra shot of Irish Mist for you. :) | |
Re: That seed_array is declared wrong -- you need a 2d array of characters. such as [icode]char seed_array[20][200];[/icode] Instead of using strchr() it might be easier to use brute-force method | |
Re: Use [URL="http://www.bandwidthplace.com/"]this bandwidth test[/URL] | |
Re: Very nice game -- enjoyed playing it. I have two problems [list=1] [*] On the menu "What would you like to do?", it has 8 menu items. Your program needs to validate that I enter a number 1 to 8. [*] There is no way to quit the game, except … | |
Re: Its not working because thread functions must be either static alss members or functions outside any class. Address of a non-static class method can not be passed to any win32 api function. Make StartThread() static and the compiler will probably take it. | |
Re: Can not be done because MFC will not give you what much control over it. All the text in the edit control is displayed in the same color. You can't use html in any mfc control. | |
Re: >>_CRTIMP FILE* __cdecl fopen (const char*, const char*); The above is a function prototype. It has an open parentheses '(' and close parentheses ')' with or without arguments between the parentheses. | |
Re: >> int numbers[ARRAY_SIZE]; {10,20,30,40,50,60,70,80,90,100} That is incorrect. Here is what you want[icode] int numbers[ARRAY_SIZE] = {10,20,30,40,50,60,70,80,90,100};[/icode] The index number is nothing more than the loop counter. Therefore you can delete the line [icode]for( index=0;index<20;index++) [/icode] then cout the value of count instead of index. | |
Re: [QUOTE=Jupiter 2;1044027] Do you think I should quit Daniweb? I'm sure Bob would agree.[/QUOTE] No -- just ignore him and maybe he will go away. Report harassing posts and he will probably get an infraction. | |
Re: Post your text file -- that worked ok for me using vc++ 2008 express. | |
Re: >>it does not work! What does that mean??? Are you getting compile errors? Yes, then post the errors and the code that caused the errors. | |
Re: google for "ODBC tutorials". You will be expected to already have a good grasp on C/C++ language. There are other ways to do it, but ODBC is the most common. | |
Re: you can not use inport and outpout with any 32-bit or 64-bit compiler. Those functions are no longer supported by the operating system. On MS-Windows you will have to use win32 api functions, starting with OpenFile() to open the com port, ReadFile() to read from it, and WriteFile() to write … | |
Re: julian dates is just a count of the number of days from 1 January to the current day of year. And that's all toJulian() is doing. | |
Re: >>Can we do this using winsock hooks. Probably not. You can hook into a browser itself, but not web pages. I suppose you could find out where a browser gets the web page from the internet and then rewrite the page. | |
Re: you never implemented the class constructor. | |
Re: >>As far as I know, the fastest way to initialize an array is to do so using a for loop... For simple data types (char, int, etc) the fastest way to initialize an array to all 0s is to use memset(). If you want to initialize it to some other … | |
Re: More info about pointers ([URL="http://daweidesigns.netfirms.com/cgi-bin/pointers.php"]link here[/URL])-- from DaWei on PFO. | |
Re: Its possible that GetOpenFileName() is sucking up your message. Call [URL="http://msdn.microsoft.com/en-us/library/ms644947%28VS.85%29.aspx"]RegisterWindowMessage[/URL]() to obtain a unique message for inter-application/thread communication. I don't know if that will resolve your problem, but worth a try. | |
Re: you want to use the substr() method, not erase(). And delete line 8 because length isn't needed (unless you want to use it somewhere else). [code] string type = temp.substr(0, pos); string value = temp.substr(pos+1); [/code] | |
Re: First you have to get a list of all the files in the folder ( see FindFirst() and FindNext() win32 api functions). Then for each of those call _stat() to get the file creation date and compare that with today's date. Finally, use remove() to delete the file. Where should … | |
Re: C/C++ use "libraries", and "dll"s (MS-Windows) not packages. How to create one depends on the compiler you are using. Normally the source code for a library is all in one folder, and it doesn't matter what the folder name is as long as your compiler knows. | |
Re: You need to look for WM_KEYUP and WM_KEYDOWN events. [URL="http://cboard.cprogramming.com/windows-programming/53284-wm_keydown-vk_escape.html"]Here [/URL]is an example thread. | |
Re: 1) what compiler are you using 2) what error messages do you get. | |
Re: [QUOTE=twomers;807227]Hey Josh. Yeh back again?[/QUOTE] Not for long -- he's been banned again too :) :) :) And this time probably permanently. | |
Re: [URL="http://www.toymaker.info/Games/html/gdi.html"]Here is one source[/URL] | |
Re: 1. Just read the fields one at a time into an instance of the Song class, then add the Song class to the vector [code] vector<Song> theList; Song s; infile >> s.title >> s.artist >> (etc etc for each field) theList.push_back(s); [/code] 2. You can use an iterator for this … | |
Re: line 77: why don't you just same the characters in a std::string object so that you can easily write it to a file?? function counter() -- its too lengthy and too complicated. The following will work if ch is always an alphabetical letter 'A'-'Z' or 'a'-'z'. [code] void counter(char ch) … | |
Re: sizeof( any pointer ) is always the same -- sizeof returns the number of bytes it takes to store the address of the pointer, not the length of the string the pointer references. So lines 12 and 13 of your code will always return the same value (probably 4). line … |
The End.