15,300 Posted Topics
Re: why can't you do that yourself? (I don't know java so I can't help you) | |
Re: call win32 api function [URL="http://msdn.microsoft.com/en-us/library/bb762153%28VS.85%29.aspx"]ShellExecute[/URL] [URL="http://lmgtfy.com/?q=ShellExecute"]More here[/URL] | |
Re: Where is the code you have tried ??? | |
Re: Maybe we could have a points system to grade questions on how stupid they are. Like "URGENT! My program's broke, please fix it, and be quick about it.". On a scale of 1 to 10, that deserves a 10 for one of the most stupid idiotic posts that occasionally come … | |
Re: why the pointers? [code] int function(user* users, int id, char name[], char surname[]){ strcpy(users[id].name,name); strcpy(users[id].last,surname); users[id].id=id2; } [/code] And in main() you need to initialize the strings and int before passing them on to that function. If you don't then your program will just be so much crap. It will … | |
Re: Must be something else. What compiler/os are you using? | |
Re: Take it one small step at a time, and soon you will have that program written. First learn how to open a file and read it one line at a time. After you have that working, learn how to split up the rows into columns (you can use stringstream c++ … | |
Re: I assume you mean SQL type databases, such as Microsoft Access, SQL Server, Sybase, Oracle, etc. win32 api does not support databases. You have to use something else, like ODBC. If all you want is simple files then use the functions in <fstream>. Google is your friend, so google for … | |
Re: >>How do i assign a string to a array? 1) add [icode]#include <vector>[/icode] 2) create an array of strings [icode]vector<string> aList;[/icode] 3) add a string to the vector: [icode]aList.push_back( "Hello World" );[/icode] | |
Re: To create a new console application: From the menu File --> New --> Project, select [b]Win32[/b] in the Project Types, then [b]Win32 Console Application[/b] in the Templates. At the bottom enter the project name and location, then hit Ok button. The rest you should be able to figure out. If … | |
Re: Check the OnTimer event handler, maybe there is something that causes the window to be repainted. | |
Re: you need to use a loop and divide the number by 10 until the result is 0. you can delete lines 10 thru 19 because they are not relevent to the program requirements. The answer to the program has nothing to do with a space. | |
Re: First you have to learn how to generate the list of prime numbers. There are lots of examples here, just search for them. Use the "Site Search" button located in the upper-right corner of the DaniWeb yelllow (gold?) band. | |
Re: you are attempting to put code outside a function. Lines 7 and 8 have to be inside a function. | |
Re: See [URL="http://www.file.net/process/netfxupdate.exe.html"]this related thread.[/URL]. If the file really is not in the directory you posted then you might need to reinstall the .NET framework. | |
Re: [URL="http://www.daniweb.com/forums/thread74906.html"]This thread[/URL] | |
Re: line 9: >> char *value = ; Will that even compile ???? >>DWORD value_size = sizeof(value); value is a pointer, and the sizeof(any pointer here) is 4 on most 32-bit platforms. you don't have to put that in a loop. Call it the first time with the size of the … | |
Re: >>What datatype should I use for storing the line? ie: the 'storelinevariable' parameter? If you use getline() then it has to be std::string object What do you want to do with the lines after they are read into memory? Do you need to use individual columns, do you want to … | |
Re: Your timer event handler is probably doing something that makes the screen to be repainted. If the event handler takes a long time to process then turn kill the timer at the beginnning of the event handler and restart it just before it returns to prevent MFC from calling it … | |
Re: [QUOTE=Ryshad;1043749]Exactly, if the OP is satisfied that the problem has been resolved then there is no need for solvers to continue contributing to the thread. Marking the thread as solved means they can see from the forum page that the OP no longer needs help. [/QUOTE] Although technically you are … | |
Re: lines 31-36: You are getting a character from the keyboard but tossing it into the bit bucket (not doing anything with it). You need to create a character array and save the characters in it. >>strtok(c," "), strtok() works on character arrays, not single characters. Passing variable [b]c[/b] as the … | |
Re: why is year a double??? There are no decimal places in a year unless you want 1.5 to be a years and 6 months. | |
Re: line 18: >> fstream* file = new fstream( "myfile.txt", fstream::in); There is absolutely no reason to complicate things more by making fstream object a pointer which has to be allocated. Just create an fstream object [icode]fstream file("myfile.txt, ios::in);[/icode]. Note that ios::in will NOT create a file if it does not … | |
Re: [URL="http://lmgtfy.com/?q=wholesale+fruit+fly+products"]Start here[/URL] | |
Re: The while statement is wrong. If I enter a '1' the loop will continuje because it is not an 'a', which is one of the tests. Try this [icode]while (test<"1" || test>"5" && test !="a" && test!="b");[/icode] | |
Re: depends on the operating system. | |
This demonstrates how to get a list of your computer's logical drive letters under the MS-Windows operating system. | |
Re: what's your program going to do if I enter 15 for rows and 20 for columns??? Do you have a question about the code you posted? | |
Re: [QUOTE=imolorhe;1045072]Please i need d code for C.[/QUOTE] Stop whining and begging. The code he provided is practically C. | |
Re: Using win32 api gdi functions you could disable the mouse by just hiding it then ignoring all mouse clicks. For keyboard, ignore the keyup and keydown events. Note that these are not standard c or c++, but win32 api functions. There is no way to do it with standard c/c++. | |
Re: Pretty simple, really [code] bool Class_name::find_a_record(ifstream& is, string name) { Class_name n; is.seekg(0, ios::begin); // start at beginning of the file // while not end-of-file or error while( is.read( (char*)&n, sizeof(Class_name) ) { if( name == n.name) // if found { return true; } } return false; } [/code] | |
Re: what compiler are you using? It compiled and linked ok using VC++ 2008 Express. You can't use iostream.h and [icode]using namespace std;[/icode] at the same time. | |
Re: why not just take the existing desktop and remove all the desktop shortcuts and start menu items except those that you want to allow. That would be a lot easier (quicker and cheaper) than trying to reinvent the wheel (desktop). And that solution requires zero programming. | |
Re: >>The problem is, I don't know how many image files there are, until a run the program, and search a folder for the files. Use either a <vector> or <list> and problem is solved. Both will expand as needed. | |
Re: >>while ((addr = ((void*(*)(void))addr)()) Didn't your compiler produce an error or warning on that line?? tryit() does not return a value, yet in the above addr is being assigned the return value of tryint(). You can't have it both ways. try this: [icode] while( addr() ) [/icode] | |
Re: C programs are allowed to declare variables only at the top of the block enclosed with { and }. So move line 42 up to line 16. | |
Re: In its simplest form: [icode]g++ stock.cpp usestock.cpp -o myprogram <Enter>[/icode] You can also install Code::Blocks which will let you easily create and compile multi-file projects. | |
Re: Because the name may contain one or more spaces you need to read the file one character at a time until the first digit is found, which will be the end of the name. [code] int i = 0; char c; while( infile.get(c) ) { if( isdigit(c) ) { infile.unget(); … | |
[URL="http://www.break.com/index/drunkest-guy-ever-goes-for-more-beer.html"]video[/URL] of a drunk trying to buy some more beer. | |
Re: >>However, some testing suggests that double still performs better! This is unexpected. Yup. floats are always converted to doubles when used as function parameters. Other factors may influence it too, such as the math coprocessor on your computer. | |
Re: Here is the difference between Girlfriend 7.0 and Wife 1.0 operating systems (I've posted this before in geek's lounge) [quote] O/T Dear Tech Support Subject: Computer Hard and Software: Dear Tech Support: Last year I upgraded from Girlfriend 7.0 to Wife 1.0. I soon noticed that the new program began … | |
Re: >> lines 12 and 53: binfile.open ("data.dat", ios::in); If this is a binary file then you need to open it in binary move [icode]binfile.open ("data.dat", ios::in | ios::binary);[/icode] line 52: add binfile.clear() to clear all file errors before attempting to reuse the same fstream. line 53: I think you have … | |
Re: line 22: >> scanf("Selection: %i\n", o); You can't combine scanf() and printf() like that, and the parameter must be a pointer to an integer [code] printf("Selction: "); scanf("%i", &o); [/code] | |
Re: After calling the first function you have to clear the stream's eof() error bit. [icode]input.clear();[/icode] should fix the problem. | |
Re: [URL="http://lmgtfy.com/?q=c%2B%2B+linked+list+tutorial"]try this[/URL] In c++ I would use either <vector> or <list> c++ classes instead of creating your own linked list as you might do in C language. | |
Re: First learn how to list all the files on one directory, then the rest should not be all that difficult. How to get the list of the files will depend on the operating system( *nix, MS-Windows, MAC, etc. etc). Most of them do it differently then the others. | |
Re: Yes, start out by opening the file and learning how to just read it. Just display the file contents on the screen. After you get that going, you should be able to start reading the file contents into the structure. You didn't say how the file is layed out so … | |
Re: I assume you did not post all the code in those two function. If you are getting just some random values then you are probably using some uninitialized variables in those function. Post the entire program so that we can see what you are doing. | |
Re: I would [URL="http://lmgtfy.com/?q=c+program+to+read+excel+file"]start here:[/URL] |
The End.