15,300 Posted Topics
Re: if you don't know where to start, here's a hint [code] int main() { // put your code here } [/code] | |
Re: [QUOTE=comp_sci11]i'm using a borland turbo C[/QUOTE] That's your first big mistake! toss that crappy compiler into the bit bucket (delete it from your computer) and get a modern C compiler that you can use to learn the C and C++ languages correctly. You can't learn to drive a 2007 automobile … | |
Re: >>What is the best way to go about getting into this field? get a college degree in computer science or some related field. competition is fierce today and you need all the edge you can get. At your age and with a young family to support that is going to … | |
Re: You are writing a c++ program, don't the input string to char* -- just use std::string's == operator (and don't use the variable name "string" because it is the name of a c++ class and will confuse the compiler. I don't know the relevance of i, but that is probably … | |
any plans to actuvate rep power, like you see on many other boards such as [URL="http://www.codeguru.com/forum/showthread.php?t=395306"]this[/URL] one? | |
Re: you could use fwrite() assuming Port_Handle is the handle to an open file. -- see C docs for description of that function. | |
Re: [QUOTE=scharan]Hi all, This is charan new member of this team. Iam having one Question to all of you What is the difference between static and dynamic Dll and how the mechanisim of static dll goes in VC++ [/QUOTE] The terms static and dynamic do not describe the features of a … | |
Re: [QUOTE=comp_sci11]can someone help me about creating a window in turbo c?? because i can't find anything about creating a window in turbo c! is there a site explaining or about creating a window in turbo c??[/QUOTE] That's because you can't do it with that compiler -- Turbo C is just … | |
Re: [URL="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vctutor98/HTML/_gs_scribble_tutorial.asp"]Scribble tutorial [/URL]is the only one I know of. There are several books at your local book store or [url]www.amazon.com[/url]. | |
Re: The main program cannot access controls in CmEdit class directly because they do not exist at the time you are attempting to access them. CDialog does not initialize the controls until OnInitDialog() is called, which is after DoModal(), and it destroys the controls when the CDialog returns from DoModal() (assuming … | |
Re: your program should be passing the structure aboud to other functions by reference instead of by value so that any changes made by the function will be made to the original copy of the structure. When you pass a structure by value the program must make a copy of the … | |
Re: If you have the Express edition of that compiler you will also have to download the Windows Platform SDK because the compiler is pretty minimal. It says its for M$ Windows 2000 Server but it works that that compiler and XP too. I think there is a link to it … | |
Re: since the lines have variable number of entries fscanf() will be little use because it requires fixed length number of entries on the line. Instead, use fgets() to read the entire line into memory than parse for spaces and assign to approirate members of the structure. you can use either … | |
Re: Of course the OP [b]could[/b] attempt to write the program himself:rolleyes: | |
Re: windows api will return the x,y coordinates of the mouse. If you know the coordinates of the image's bounding rectangle then you just need to find out which image rectangle contains the mouse coordinates. Using MFC will simplify that, but you can also use windows RECT structure and write your … | |
Re: attempt to open it with fopen() or ifstream::open(), depending on C or C++ program. | |
Re: here is a pure c++ version that replaces the C-style char array with std::string and removes the tmp variable altogether. From the looks of this function it must be just a code snippet of a larger more complex function, is that right? If it isn't, then you can remove vector … | |
Re: >>printf("table 1 is %d\n", table_1); That only prints the memory address of the beginning of table_1, which is an array of binary data. I have no idea what is stored in that array, you might get an idea from the program that contains the array. | |
Re: LogonUser() will allow you to log onto the computer if you know a valid user name and password. There are no functions to retrieve the password of a given user -- it would be a huge security violation if there was such a function. | |
Re: You can find two tutorials [URL="http://www.relisoft.com/Win32/generic.html"]here[/URL] and [URL="http://www.winprog.org/tutorial/"]here[/URL] | |
Re: post your code using std::string because it does work with that. replace strstr() with the std::string's find() method, like this [code] for(int i=0; i<20; i++) { if( data[i].find(search) == string::npos ) cout << "NO MATCH" << endl; else { cout << data[i] << endl; incVar++; } } [/code] | |
Re: unless you just happen to have the source code for notepad and MSWord (which is not very likely), the first two questions are nonsense and unanswerable unless they are answered in the text book where you got those screwy questions. I don't know the answer to 3. | |
Re: ODBC is the most common way to access SQL databases. Search google for ODBC and you will find some c++ classes. Example [URL="http://www.codeproject.com/database/DataLayer.asp"]here[/URL] and [URL="http://www.codeproject.com/database/#ODBC"]here[/URL] | |
Re: why don't you make i a local variable and function() return its value. [code] #includes.... int function() { [color=red] int i = 0; [/color] while(charbuff[i]!=' ') { ofstream stream("file.lng", ios::app) stream << charbuff[i]; i++; stream.close(); } [color=red]return i;[/color] } main() { ........... some code [color=red] int i = [/color]function(); /*call … | |
Re: [URL="http://www.emsps.com/oldtools/mscpp.htm#vcpp15"]Here[/URL] seems to be a source where you can get that compiler. I don't know if that link is still any good. | |
Re: there are two ways to declare a one-dimentional array (1)??? calculateEarned(worker array[]); and (2)??? calculateEarned(worker * array); but there is only one way to declare the return value, using a pointer to the beginning of the array. worker* calculateEarned(worker []); | |
Re: you can google for cgi programs. [URL="http://cgi.resourceindex.com/"]Here[/URL] is one suggestion. | |
Re: allocate the array with either malloc() or new, depending on whether you are writing a c or c++ program. | |
Re: why do you think that registry key is going to launch mydll.dll every time a program is run? I tried it on my XP computer and it does nothing too. | |
Re: what compiler are you using? my guess is Turbo C, but I could easily be wrong. As for unused variables -- just delete them from the program. >> strcpy(fn[p],fn); fn is a character array, fn[p] is a single character somewhere in that array. strcpy() expects the first parameter to be … | |
Re: use FindFirstFile() and FindNextFile() to loop through all the files in a directory. Search MSDN and you will find some examples. | |
Re: [rant]flow charts are evil little critters and should be banned from all educational institutions. I've never seen anyone create or use them outside the university. And most programming books don't even talk about them.[/rant] ![]() | |
Re: I can't help you with the math (have no clue what a quetelet is) but you will need to add a getch() immediately following that scanf() to remove the <Enter> key from the keyboard buffer. scanf() does not do that for you. | |
Re: you can't use flat memory model in real mode because segmentation is different. You can use a dos extender, such as Pharlap, that switches back and forth between real and protected mode, but your flat memory model program runs in protected mode, not real mode. The dos extender switches to … | |
Re: there is nothing wrong with your compiler. It does not work as you expect because the code you posted as undefined behavior. | |
Re: Most common way to connect to any database is via [URL="http://www.google.com/search?hl=en&sa=X&oi=spell&resnum=0&ct=result&cd=1&q=ODBC+c%2B%2B+class&spell=1"]ODBC[/URL]. Here are some [URL="http://www.google.com/search?hl=en&lr=&q=ODBC+tutorial&btnG=Search"]tutorials[/URL]. | |
Re: how is update_record defined? It would appear to be a structure, not a simple string as you illustrated. We need more information to help you. | |
Re: what operating system? MS-Windows? use FindFirstFile() and FindNextFile() to get a list of all the files in dir A, store the filenames in a string array. Then use the same functions to get the files in directory B. For each file in B search the array of filenames you created … | |
Re: If the file is pretty much static (doesn't change very often) then you can create an index file that contains just the offsets into the master data file of the beginning of each record. Then when you want to read the 50th string just read the offset in the 50th … | |
Re: Unfortunately there is no standard c or c++ way to accomplish that. So you have to resort to some non-standard functions that you compiler may support, such as those in conio.h. I believe the functions in that header file were originally developed by Borland for their Turbo C compiler, but … | |
Re: 1. it is not necessary to specify ios::in for ifstream, that is what ifstream does anyway. 2. use std::string's c_str() method when passing it to the constructor ifstream openfl(file.c_str()) 3. cin >> file; This construct will work as long as there are no spaces in the filename and optional path. … | |
Re: I hope this is an old program you have that you need to change because it is written in ancient original K&R style. There are several changes you have to make -- and below may or may not be all of them (1) change [b] if(argc != 2)[/b] to [b] … | |
Re: The function that callers ConvertToChar() must delete the memory when done with it. That's a common requirement of programming. Of course you could also return std::string instead of char* which would eliminate the need for allocation -- but if this is for eVC++ compiler you won't have that option. A … | |
Re: is it possible to have 5 stars but a rep power of only one green square thingy? | |
| |
Re: You will probably get NO useful responses by spamming this board with your homework assignments. Since you did not as a question I suppose you expect somebody to do the work for you. | |
Re: >> cin << math_operator; you used the output operator, not input. You meant this: cin >> math_operator; >> case 's': main() Not allowed to call function main() in either c or c++. You will have to think of a different way to restart the program. | |
Re: >>Can you please modify the code so ... No, I don't do homework for anyone. >> s = malloc(sizeof(char)); This just allocates one character, causing a 1 byte memory leak on every loop iteration. >> s[index] = inputBuffer; Since the malloc allocates only one character, this line will just scribble … |
The End.