15,300 Posted Topics
Re: [URL="http://geometryalgorithms.com/Archive/algorithm_0108/algorithm_0108.htm"]This[/URL] seems to be a promising link. I only quickly scanned the article but looks like it has some code. [URL="http://www.google.com/search?hl=en&q=Bentley-Ottmann+Algorithm&btnG=Google+Search"]google [/URL]can be a programmer's best friend sometimes. | |
Re: Not a good idea to use doubles in switch statements because they are often inprecice due to the way they are stored in memory. If you really have to use switch instead of that if statement then you should multiply it by 100 then assigned the result to an integer. … | |
Re: Does it matter how long the delay is? You can use time() to delay for a specific number of seconds. You need one time_t object and set it to the current time. Then enter a loop until the value returned by time() minus the original time equals or exceeds the … | |
Re: >>what i want to be sure is, after function statements does the allocation space dissapear Yes because you sent the pointer by value and not by reference. You need to send a pointer to a pointer which requires two stars not just one. [code] Allocation(&ucBufr); void Allocation(unsigned char ** ucBufr) … | |
Re: We are not a software factury where you can get the answers to all the programs you teacher might ask you to write. Think about what you are required to do then write an outline of the program. After that you should be able to code the program. only when … ![]() | |
Re: [QUOTE=neuronimbus;422419]The URL given above is showing - Video is not available....[/QUOTE] The link works ok for me. | |
Re: That's all we need are more laws to do stuff that we already have sufficnent laws. Animal cruelty is already illegal and has done very little to stop it. So that makes you think more laws will help ??? Its not the job of our police to protect the animals … | |
Re: [QUOTE=cscgal;366398] Does anyone else want them back as well? [/QUOTE] No, can't say that I would find them useful. I do, however, use "Posts Since Last Visit" and "Todays Posts" a lot. | |
Re: >>i'm just trying to check my code u all if it's correct does it do what its supposed to do ? If yes, then its ok. If not then you need to fix it. One problem though is that your program will produce data overflow errors if the value of … | |
Re: [QUOTE=ramavundela;421901]i didn't know about c graphics,unix,linux.but with my knowledge i want to do a project.can i ?[/QUOTE] Forget about doing any projects for now -- juist concentrate your efforts on learning the language. You can read books (see your local library for free copies), get online e-books, or read links … | |
Re: >>if suppose an device Its "a device" -- see [URL="http://andromeda.rutgers.edu/~jlynch/Writing/a.html"]these grammer rules[/URL] >>is this possible in c? Yes. I think you will have to write a device driver. But you first have to decide what operating system you want to use. MS-Windows you get the [URL="http://www.microsoft.com/whdc/devtools/ddk/default.mspx"]Windows DDK [/URL](Device Driver Kit). | |
Re: But you can never achieve the oridinal number of digits even when you set the precision to something larger, such as 30. The most cout will display are 15 digits. Probably have to use some other math libraries, maybe boost, for that huge number of digits. | |
Re: I hate it when teachers teach undefined behavior. :angry: The value of [b]j[/b] will depend on the compiler you are using because the language does not define the behavior of [b]i[/b]. | |
Re: It depends on the compiler and the operating system. You can use an os-independent compiler such as QT which as gui support for *nix, MS-Windows and MAC (others I don't know about). Or you can use os-specific libraries such as win32 api function and MFC class for MS-Windows. There are … | |
Re: did you read the [b]Read Me[/b] thread at the beginning of this board? If not, then you should. >> Is there any free tutorials in C that is very good No. If you are serious about learning the language then buy any of the many books available at your local … | |
Re: The posted code is not really much of a benchmark program and will not adequately make the test you want with it because the programs are just too trivial. | |
Re: There are millions of examples because they are frequently used in every-day applications. But a simple introduction might be to write a function that sets all the bytes of a character array to 0. Function prototype might be [code] void clear_array(char* array, int size); [/code] | |
Re: See this MSDN article -- scroll down the page to the section [b]Communications Resources[/b] >>Also please let me know how to test on the second PC after transferring data from the first PC. You need to write the software yourself that will run on each PC. On PC #1 write … | |
Re: >>how do i initialize it if i don't know how many names there will be? If you use c++ vector class you don't need to know how many names because that class will expand and contract as needed. >>if i want to write a sort function, how to i call … | |
Re: that's because the loop is wrong. You don't need to use eof() at all [code] while( getline(inData, line) ) { size++; // do other stuff here } [/code] | |
Re: Ok you have the function prototype, now create a structure with the required data members and a pointer to the head of the linked list. After that fill in the function you posted with the code. Read some of the other threads here and you will find several similar examples. | |
Re: see the link near the bottom of [URL="http://www.deitel.com/Books/CPlusPlus/CPlusPlusHowtoProgram6e/tabid/2046/Default.aspx"]this page[/URL]. But I don't know if it is free or not. | |
Re: [URL="http://www.winprog.org/tutorial/"]Here [/URL]is another popular tutorial | |
Re: you will need to create a thread that just listens for and receives data from the socket then, when ready, sends a message to the main form thread that the data is ready. I assume QT has mechanism to send and receive messages among threads. | |
Re: some compilers may support strupr() and strlwr() which convert the entire string, but its not standard. You can easily write such a function yourself. | |
Re: you have to use os-specific functions. What compiler and what operating system ? | |
Re: what operating system and what compiler ? | |
Re: When you add the node to the list in get_input() add it to the tail, not the head. There are at least a couple ways to do that. 1) search for the tail of the list each time you want to add a new node to the tail, or 2) … | |
Re: please re-read my answer to [URL="http://www.daniweb.com/forums/thread86279.html"]your previous thead here[/URL]. I already answered this question. | |
Re: The major problem you fase is the operating system you plan to use. MS-Windows and *nix will not permit programs to access the ports directly like that program you posted. Only MS-DOS will permit it. Search some of [URL="http://www.google.com/search?hl=en&q=serial+port+device+drivers"]these google links [/URL]to see it they contain anything useful to you. | |
Re: I get spam in my email box several times a day. Don't recall seeing any about sex for quite some time now. Most of the ones I get now are like "How to make millions by doing nothing". | |
Re: >>thanx for ur reply..but i am not familiar with fgets function.please help. Look it up in your text book or online. You can't learn to program if you have to ask us for every keyword and function you want to use. You can use google to find all standard C … | |
Re: Never heard of such a thing -- a printer that prints onto CD's ?? I can only assume you are not referring to a normal paper printer. If not, then you will probably have to contact the manufacturer for a programmers manual and device driver. | |
Re: line 7: [b]your_name[/b] is a single character and you are attempting to use it as if it were a character array in line 41. Change the declaration in line 7 to be a character array. Or, better yet, since this is a C++ program change it to be std::string class … | |
Re: whether its working or not -- DO NOT DOWNLOAD THAT FILE. Never ever download a file with *.doc extension because it could contain nasty viruses, worms, etc. | |
Re: line 10 will cause program crash because no memory has been allocated for [b]name[/b] -- its only a pointer that points to some random memory location. Since this is a c++ program why don't you use std::string class instread? [code] include <fstream> #include <iostream> #include <string> using namespace std; int … | |
Re: >> temp->name=new_person[]; Is that line 130? You can not assign char arrays like that. You have to use strcpy() instead, like this: [code] #include <cstring> <snip> strcpy(temp->name,new_person); [/code] >> temp->next=Front; >> Front=temp; Circular reference -- is that what you really want ? It results in Front->next == Front, and you … | |
Re: [QUOTE=jwenting;406492]To your parent you'll always be the little kid who has to have his diapers changed every few hours. Better get used to it, they'll still think of you (subconsciously) like that when you're 50 and they're 80 or so.[/QUOTE] Yup, that's right. My [b]baby[/b] girl is 38 years old … | |
Re: If you use getline() on line 64 you will avoid the space problem. getline() will read the entire line, then you can separate it into comma-separated tokens. Line 61 is incorrect -- you should avoid using eof() like that because it will cause problems. Use getline() instead, something like this … | |
Re: Quite often working lots of hours is counter-productive. I recall a couple times I put in 72 hour days and the solution hit me after I finally went home. Working 80-hour weeks often is a bad bad idea because the mind needs a period of rest and relaxation. If your … | |
Re: you could also make it a structure that contains a union, something like the VARIANT structure that is used frequently by MS-Windows compilers such as VC++ and VB. It looks like this: [code] typedef enum { UNKNOWN = 0, STRING, SHORT, <etc. etc. for each data type } DATATYPE; structure … | |
Re: If that is the binary representation of the integer, then just typecast it or memcpy() it. [code] char array[some_number]; int n = *(int *)array; or memcpy(&n, array, sizeof(int)); [/code] | |
Re: use clock() to get the time before starting the algorithm and again afterwards, then subtract the two times. For example [code] clock_t start = clock(); // do something, such as call a function clock_t end = clock(); clock_t diff = end - start; [/code] | |
Re: The only problems I found were: 1. The structure [b]next[/b] was incorrect [code] typedef struct _nodeList { unsigned int pointCode; struct _nodeList *next; }NodeList; [/code] 2. right_configuration() must return a value. | |
Re: [QUOTE=quintoncoert;416958]can one of you perhaps explain to me exactly why you believe global warming to be a natural event? especially since consensus amongst scientists is that it is a manmade event? .[/QUOTE] Simple -- its been going on for about 2-3 billion years now. And scientists have found evidence of … | |
Re: [URL="http://www.fedex.com/us/promo/food_import_regulations.html"]This[/URL] and [URL="http://www.fas.usda.gov/itp/ofsts/us.html"]this[/URL] are probably the places to start. But you may need the services of a lawyer to get specific information about the food you want to import. | |
Re: I wouldn't have lisened to that with or without the lyerics but I agree that AT&T should not have censored out thouse lines. Maybe the webcast editor will get canned or at least disciplined. Don't know if its grounds for a lawsuit or not. | |
Re: The way I do it is somewhat like Hamrick suggested -- create a project then change the source file(s) as needed. I test out many of the programs posted on the C and C++ boards that way. |
The End.