15,300 Posted Topics
Re: You get PMs from Happygeek. Although honestly I have never heard of those people who mentioned me as a referral, at least I don't recognize their user names. | |
Re: >>I'm only new to C++ and need urgent help with an assignment that's due tomorrow. Procrastinating did you :) You can not leave programming assignments until the last minute, if you do you will fail the course. Programming takes lots and lots of time and effort. Do the program one … | |
Re: I have [URL="http://www.worldcommunitygrid.org/"]World Community Grid[/URL] on my 4-core computer. It uses each of the cores to run different programs at the same time. | |
Re: what line number does that error occur on ? | |
Re: why not just pass the linked list by reference [code] Link<std::string> filled; //fill filled with data TransferLink(filled); //other file void Link<T>::TransferLink(Link<T>& start) { // fill in the linked list here } [/code] | |
Re: >>word = (word*)malloc(num * sizeof(word)); You can't malloc() a non-pointer variable. Change line 49 to [icode]char **word;[/icode] then change line 60 to [icode]word = malloc(num * sizeof(char *));[/icode] You will have to redesign other parts of that code too. The loop that appears before the malloc() will not work after … | |
Re: [QUOTE=vegaseat;789715]In the news: Citicorp Bank just bought a new corporate jet for $50 million with some of their bailout money.[/QUOTE] due to bad publicity and public outcry that jet was cancelled. I hope Obama makes those bankers pay back every penny or put them in prison for the remainder of … | |
Re: The problem is most likely DLLs. I have seen similar error on Vista. Make sure you compile the program for Release mode, not Debug mode. How to do that will depend on the compiler you are using. | |
Re: Since the fields are separated with | I think it would be easier use fgets() to read the entire line then parse the string using strtok(). [code] char line[255]; while( fgets( fp1, line, sizeof(line) ) != NULL) { char* ptr = strtok(line, "|"); strcpy(fms->headCategory->categoryID, line); ptr = strtok(NULL, "|"); strcpy(fms->headCategory->fareType,, … | |
Re: you can't do it with that compiler. Get yourself a free copy of a modern compiler and it will create all the nodes you want. There are several free compilers, such as Code::Blocks, Dev-C++, and VC++ 2008 Express. Just google for them and you will find them. I ran your … | |
Re: >>is it possible to have two different names of one functions Short answer: no However, what you could do is put all the common code into a single function which is called by the other two functions [code] int common_code(int info) { // blabla } int do_my_server(int info) { common_code(info); … | |
Re: >>1) How could time (in the form of HH: SS above) be represented in the array, so >>that they can be subtracted? How do you subtract when Don't put the dates/times in an array at all. Convert the time read from each line into seconds, then all you have to … | |
Re: what don't you understand about those problems? Q1: once you know what [URL="http://en.wikipedia.org/wiki/Pythagorean_triple"]Pythagorean triples are [/URL]then the rest is not difficult. Try to write the program yourself, and post the code you have written if you still can not solve the problem. If you was able to do Q4 then … | |
I read somewhere that someone would pay for me putting their links in my signature (not necessarily ME but anyone). Is that just a scam to get people to post their links ? | |
Re: At line 17 of the code you posted the variable [b]j[/b] is only visible in that for loop. If you want to use that variable again on line 21 it will have to be declared again just like it was on line 17. Another way to fix the problem is … | |
Re: Welcome to DaniWeb. Location: Do you mean Colorado USA? We have a lot of non-Americans here and CO doesn't mean much to them. >>Relationship Status: Married--I live in a zoo. Maybe you should think about sleeping in separate bedrooms from now on :) | |
Re: It goes into an infinite loop when page count goes down to 0 but time is greater than zero. When at line 159 the value of page is 0 the program executes the else statement at line 171. Notice that the value of tim does not get decremented there. | |
Re: declare the macro _UNICODE and UNICODE, then include <tchar.h> for the macros to convert char* string literals to wchar_t* string literals. There may be more to it than that, I have not tried it with Dev-C++. | |
Re: I get similar behavior on occasion. What I do is click somewhere else on the window that has no links, only white space. After that the blue link will usually work right. Another thing you can try is copy the link location onto your computer's clipboard and paste it into … | |
Re: If you want the friend function then preceed the function name by :: [icode] return ::gcd(nominator, denominator);[/icode] | |
Re: What compiler did you use to compile that ? I tried to compile it with VC++ 2008 Express and got billions of errors. The first error was undefined function count_file_values() that appears on line 15 of the code you posted. So, don't complain about the program not working right when … | |
Re: depends on the compiler and operating system. most likely that matrix is overrunning stack space. | |
Re: Change proc_new_disk_reques() to return a pointer and your program should compile [code] [color=red]DiskRequest* [/color] proc_new_disk_request(int procnum, int sectornum, ReadOrWrite rw) { DiskRequest *new_request; new_request = (DiskRequest *) checked_malloc(sizeof(DiskRequest)); new_request->dr_procnum = procnum; new_request->dr_sectornum = sectornum; new_request->dr_rw = rw; new_request->dr_next = NULL; return [color=red]new_request;[/color] }[/code] Note that at some point in the … | |
Re: why are you using [icode]std::list< std::string > rolodex[/icode] instead of [icode]std::list< Card > rolodex[/icode] ? | |
Re: win32 api function is very simple -- just a one-liner [icode]MessageBox(NULL, "Testing", "Title Here", MB_OK);[/icode] MFC is even a little easier. I think the .NET version is just as easy [icode]System.MessageBox(<blabla>);[/icode] or something like that. | |
[URL="http://www.youtube.com/watch?v=0gsJBYx3qYM&NR=1"]Banned Airplain Accident[/URL] [URL="http://www.youtube.com/watch?v=nwSalVn0Muk&feature=player_embedded"]And here is a variety of them.[/URL] Nice YouTube video. | |
Re: [QUOTE=Skainstein;850289]Hi all. Could anyone please put comments on each command that Ancient Dragon posted? It's just to be sure what each of them means. I'm having trouble compiling this: [code=c++] //blabla char OutFile[100]; FILE* fp; sprintf(OutFile,"wind%d", date); fp = fopen(OutFile,"w"); OutFile << "Longitude\tLatitude\tDirection\tVelocity\n";//here appears an error!! //blabla [/code] Maybe there … | |
Re: [URL="http://www.cplusplus.com/reference/clibrary/cmath/"]Read this[/URL] | |
Re: [quote] [icode]char * strncpy ( char * destination, const char * source, size_t num );[/icode] No null-character is implicitly appended to the end of destination, so destination will only be null-terminated if the length of the C string in source is less than num.[/quote] [url]http://www.cplusplus.com/reference/clibrary/cstring/strncpy/[/url] In your example [icode] strncpy(Hour, … | |
Re: How much time did you say you have ??? [URL="http://www.spikenet-technology.com/download/SNVisionSDKdatasheet.pdf"]Here[/URL] is one such software that took 15 years to develop. | |
Is it possible to add animated gif files to posts? I have tried [noparse][img] [/img] [/noparse] but it doesn't work. I've also tried to upload a gif file using the URL option, but that fails too. | |
Re: google found [URL="http://www.codase.com/search/call?name=GetPrivateProfileString"]this example [/URL]pretty quickly | |
Re: [code] ReadFile(com_port,&output,readlength,p_readlength,NULL); std::cout << output<<std::endl; [/code] In the first line the 4th parameter is nothing more than a pointer to the 3d parameter. declaring another pointer is not necessary. And do not put & symbol whan passing character arrays. [icode]ReadFile(com_port, output, readlength, &readlength, NULL);[/icode] >>std::cout << output<<std::endl; That's the reason … | |
Re: >>MyClass <DataType,int>:: search' : not all control paths return a value Yes, tis true. The function can terminate without returning a value. When [icode]if ( (node->data).key == key)[/icode] is fales, the else statement is executed and the function terminates without returning a value. | |
Re: [QUOTE=yollyP.;777036]I'm still not at-ease in giving credit card information through the net, and any personal information whatsoever. [/QUOTE] I'm with you -- I don't buy anything on the net unless that's the only way to get it. There are just too many instances of where huge company databases have been … | |
Re: simple example [code] #include <map> #include <string> #include <iostream> using namespace std; int main() { std::map <std::string, int> m; m["cpp"]++; m["exe"]++; m["exe"]++; m["exe"]++; m["exe"]++; m["ppt"]++; m["ppt"]++; m["ppt"]++; std::map <std::string, int>::iterator it; for(it = m.begin(); it != m.end(); it++) cout << it->first << " = " << it->second << "\n"; } … | |
Re: Congrats on your first star. :) But ... [URL="http://www.daniweb.com/forums/thread108723.html"]but you already posted here[/URL]! | |
Re: line 20: the >> operator will not allow you to put spaces in the filename, such as path with spaces line 22: fflush(stdin) is non-standard and not supported by may compilers. Unfortunately, there is no standard way to flush stdin. But if you use [icode]std::cin you can use cin.ignore(1000,'\n'); [/icode] … | |
Re: >>I am trying to print chars as numbers. I'm just wondering how to do this. Easy [code] char c = 'A'; printf("%d\n", c); [/code] | |
Happy Easter everyone, even to those of you who are not Christian. I worked last night at Wal-Mart and I can tell you we sold out of almost everything eatable -- was almost like Christmas. 10:00 p.m. and there were very very long lines. But that's not the point of … | |
Re: Forget vb version 6 -- its obsolete because vb.net replaced it. | |
Re: You are going to have to tell us what that program does not do that you want it to do, or what it does wrong. We are not clairvoyant nor are we mind readers. | |
Re: >> while( ch1 != EOF ){ That won't work because (1) ch1 must be an integer, not char and (2) EOF is not known until it attempts to read beyond end-of-file, not before. Don't read the file one character at a time, but one line at a time. Use fgets() … | |
Re: If you use google you might be able to find a calculator program. Otherwise, please follow the links in my signature. | |
Re: 1) Move the structure definition in lines 49-55 up above any functions, about line 13 because it makes better overall program organization. Most programs are organized to have all includes at the top followed by structures, classes, enumerations (in any order or in header files), globals and function prototypes. You … | |
Re: Do a print screen then attach the bitmap so we can see what you mean. | |
Re: [URL="http://lmgtfy.com/?q=bubble+sort+c"]try this[/URL] | |
Re: line 47: breaks are not used with if statements, so delete them. What don't you understand about your program? | |
Re: On your Mobile 5.0 computer, after exiting the application check the computer's memory to see that it really exited and not just hidden. Also, make sure the program closes the port before exiting. What is it trying to do in that tight loop ? Trying to open the port, but … | |
Re: PointerArray is a two-dimensional array, right ? You have to allocate both dimensions [code] PointerArray = new int *[HEIGHT]; // allocate an array of int pointers for(int i = 0; i < HEIGHT; i++) PointerArray[i] = new int[LENGTH]; [/code] The above will allocate what would be statically allocted like this: … |
The End.