15,300 Posted Topics
Re: [URL="http://msdn.microsoft.com/en-us/library/3y1sfaz2(VS.80).aspx"]Here [/URL]is an explaination of how I use it. I always use it with __declspec and don't have a problem. It does not affect the .DEF file -- actually the DEF file is not even needed when dllexport is used. | |
Re: Yes, writing GUI in c++ is pretty difficult stuff. Other languages such as python, vb, and C# are better suited for that. I don't think you can process mouse events like that in console programs. The program needs a message pump in order to get and process windows event messages, … | |
Re: Also read the [b]Read Me[/b] links at the top of this board. | |
Re: There is no standard way to do that in C or C++ because the languages don't know a thing about the function or arrow keys. But there are work-arounds and they all depend on your compiler and operating system. One way is to use the [b]curses[/b] library, or pdcurses on … | |
Re: Do you know how to create a class? Lets start with the easiest one -- date [code] class date { }; [/code] Next you want to add a few data objects, such as day, month and year [code] class date { private: int day; int month; int year; }; [/code] … | |
Re: line 87: array elements are numberd from 0 to but not includeing the number of elements in the array. So that loop should be coded like this: for (int hw_c = [color=red]0[/color]; hw_c [color=red]<[/color] MAX_HW; hw_c ++) line 89: that's initializing the wrong array. It should be initialzing array [b]hw[/b]. … | |
Re: structs are nearly identical to classes, so maybe you need to add an = operator [code] struct if1 { string idnum;//id number for the student string lastname;//last name of student string firstname;//first name of student int examscore[maxexam];//array of all the exam scores of the student int hwscore[maxhw];//array of all the … | |
Re: Two suggestions: 1) Learn to write better English. Practice makes perfect. 2) Post your resume in the [URL="http://www.daniweb.com/forums/forum52.html"]Post Your Resume[/URL] board. | |
Re: 1) file size is an unsigned integer not a double. 2) >> double filesize = path.size(); All that is doing is getting the number of characters in the string, not the file size Here is how to get the file size [code] size_t fileSize = 0; string path = "C:\\Folder1\\Folder2\\OneFile.txt"; … | |
Re: Are you talking about writing a plug-in for Windows Explorer ? When you right-click a file in Explorer it will add to its popup menu item(s) that you write ? I have seen something like that I think at [url]www.codeproject.com[/url], but don't recall how it is done. [edit]Ok I think … | |
Re: I'm not sure how to play this game but here are my answers [code] Choose one 1. Make a move 2. Save the game 3. Quit 1 Player 1 Would you like to move piece A, B, C, or D? a Please choose a move 1 2 3 4 X … | |
Re: The nodes might be easier to sort if you put the data in another structure [code] struct data { string bookTitle; vector<string> authors; }; struct node { struct data* pData; node *next; }; node *start_ptr [/code] Now when a swap needs to take place all you have to do is … | |
Re: I think it opens the file, gets the file length, allocates a buffer if the required size, then checks if any character elements is > 126, which is the upper limit of the text characters in the standard ascii chart. So I would think this would work. Note: the following … | |
Re: [QUOTE=linux;571700]You know you're obsessed when you have more posts than the creator of the forum, and you joined three years after her. *cough*jbennet*cough* :)[/QUOTE] That's not hard to do when you play those silly games in the games forum. | |
Re: >>Is this best solution? No. srand() should only be called once during the lifetime of the program. Leave lines 12 and 14 but delete lines 18, 20, 24 and 26. >>#include <conio.h> That is non-standard function. If you want [b]best[/b] solution than delete it. line 45: delete it. use cin.get() … | |
Re: pipes don't work at all in win32 programs, only console programs on Ms-Windows platforms. See the discussion [URL="http://msdn.microsoft.com/en-us/library/96ayss4b.aspx"]here[/URL] for work-around. | |
Re: create an ifstream object and use its >> operator to skip the first word and read the second. [code] ifstream in("file"); string word; in >> word; // read "Add" in >> word; // read the digits [/code] | |
Re: with your feet :) That probably means to create a loop and inspect each element. For example: [code] int array[5]; for(int i = 0; i < 5; i++) cout << array[i] << " "; [/code] | |
Re: you have to call srand() to generate a new set of numbers - and its only called once at the beginning of the program. [code] #include <stime> ... int main() { srand( time(0) ); } [/code] | |
Re: post the code you have tried. When the first letter is 'o' then just call strcpy() to copy the entire word. But whether that will work or not all depends on how you declared the two arrays. Post how you declared the two arrays and the rest of your program. | |
Re: I have no idea what it is doing either, but it displays an interesting map. | |
Re: [URL="http://www.google.com/search?hl=en&q=c%2B%2B+sql+classes"]read these google links[/URL] | |
Re: Welcome to DaniWeb. Chicago, the windy city. My brother lives near Chicago. Do you know him :) For those of you who might not know, Chicago is USA's 3d largest city with about 10 million people. Its so tiny I just assumed Wordgunner would know my brother. | |
Re: Look up the functions in MSDN. It will often provide C++ examples as well as C#. | |
Re: >>you could also use signature links Yes, that's a good suggestion. Here at DaniWeb you can go to your [b]Profile[/b] and add your links to your signature. Then do a whole bunch of posting in other threads to help others or in [b]Geeks Loung[/b] just to talk. | |
Re: Sounds like a good place to never visit :-O | |
Re: A literal is a string of characters inside quotes. For example [icode]char str[] = "Hello World";[/icode] In the above, [b]"Hello World"[/b] is considered the literal. | |
Re: >>get a fair amount of warnings, but i can live with warnings You are crazy if you do because most warnings are really errors. Fix them. line 2: never ever at any time should you include one *.cpp in another like that. Compile them separately and link them together. That's … | |
Re: [QUOTE=Zubb;601274]A fellow mate from class gave me that code, he's been working on. I posted it here to see if it was correct or not.[/QUOTE] So, you wanted to hand in some else's piece of crap as your own ?? Don't you think your instructor will notice the resemblence? | |
Re: First, delete that compiler from your computer since the free trial has expired. Next, download the free [URL="http://www.microsoft.com/express/vc/"]VC++ 2008 Express[/URL]. This is NOT a trial version and does not expire. As for the *.exe requiring Visual Studio, it depends on how you program. You can freely distribute the files located … | |
Re: [edit]On second thought, I don't think below is what you are looking for[/edit] Here's how to hide the console window [code] #include <windows.h> int main() { HWND hWnd = GetConsoleWindow(); if(hWnd) ShowWindow(hWnd, SW_HIDE); Sleep(5000); } [/code] | |
Re: you must close the file before it can be deleted. use fin.close() before attempting to delete it. | |
Re: >>Any ideas what I should request for a salary for an entry level developer Yes, ask for at least $1,000,000.00 USD per hour :) | |
Re: windows and *nix have different implementations so you can't use the same program for both. For MS-Windows you include <windows.h>. You can use threads by calling CreateThread() in console programs, but I think it will requires a win32 windows program to successfully use the SetTimer() and KillTimer() functions because the … | |
Re: I would assume the transaction file is in no particular order -- rows are appended to the transaction file as they occur, which can be in any order for any given account. To update the balance in the master file you will have to read the entire transaction file to … | |
Re: >>and I'm supposed to include an application file, but I don't have the slightest clue by what the professor means by that The application file is a *.cpp file that contains main(). I would assume from your comment that main() should not be in the same file as the class … | |
Re: what programming language is that ? Need to move this thread to the appropriate board for that language. | |
Re: The file is still open. Close it first before trying to rename it. Move line 22 up to about line 16 | |
Re: You are on the right track. How did you declare those arrays ? And what is [b]inquestion[/b]? | |
Re: >>Why the selection sort output not appear? Because it is never called. | |
Re: When you call getline() it will return an empty string when there is an empty line. Example: [code] #include <iostream> #include <fstream> #include <string> using namespace std; int main() { string line; ifstream in("stdafx.h"); if( in.is_open() ) { while( getline(in,line) ) { if( line == "") cout << "Empty line\n"; … | |
Re: Here is how I code that function. [code] void testSort(int test[], int SIZE) { for (startScan = 0;startScan < (SIZE-1); startScan++) { for(int count = startScan +1; count <SIZE; count++) { if (test[startScan] < test[count]) { int temp = test[startScan]; test[startScan] = test[count]; test[count] = temp; } } } } … | |
Re: you might try [icode]#pragma optimize(...)[/icode] [URL="http://msdn.microsoft.com/en-us/library/aa273912(VS.60).aspx"]See this[/URL]. | |
Re: lines 27 and 29: what is that '/' character doing there? Your compiler whould have given you an error on those lines. To stop the loop at line 72 you have to enter Ctrl+Z + Enter keys. | |
Re: Here's how to do it. [icode]fprintf(myfile,"Set wallpaper= \"%s\"\n",textbox1->text);[/icode] | |
Re: It required the gcc comcompiler, which I don't have. But after uncompressing the file read the [b]readme.txt[/b] file. | |
Re: >>void addCourse (courseInfo addList[]) It would be better if all you did was pass only one array element and pass it by refernece [code] void addCourse (courseInfo& addItem) { cout << "Enter the course title:" << endl; cin >> addItem.courseName; cout << "Enter the course CRN:" << endl; cin >> … |
The End.