15,300 Posted Topics
Re: The head node itself appears to be uninitialized, except for the next pointer. Try changing the insert() method so that if head == NULL its set to current instead of allocating another new node. [code] void BulletList::insert(int posx, int posy) { node* current = new node; [color=red] (*current).next = NULL;[/color] … | |
Re: >>I don't know how to debug my own code, Well, you had better start learning. The first thing you need to do is to tell us what's wrong with the program? What does it do that it's not supposed to do, or vice versa. The first thing I noticed is … | |
Re: [QUOTE=Phaelax;85458]Can't seem to figure this out. [CODE] string *array; void addNodes(string names[]) { array = names; //how many elements in the array??? } [/CODE][/QUOTE] std::string has a function [b]size()[/b] that will tell the current size. [code] void addNodes(string names[]) { cout << "size of array is " << names.size() << … | |
Re: >>First off, this is my first c program and i am by no means a programmer so ignore me if i don't meet your standard and let those willing to show me how it is done respond. What a rude first introduction and first impression! Guess I'll just stop reading … | |
Re: There is nothing in limits.h that will help in this assignment. You will need to use the sizeof operator to obtain byte sizes of data. | |
Re: I don't think there is, but I'd also love to have one to make it easier to view DaniWeb on my new Galaxy tablet. | |
Re: >>So, how do you grow a circular array? You don't. The array itself never changes size. When the current pointer reaches the end of the array then just reset the current pointer back to the beginning of the array -- hence its name is "circular". | |
Re: Expand the program to include customer billing and employee pay/data. Also mail customers reminders when their pets are due for shots etc (mine does that is why I mentioned it). | |
Re: One way is to call strstr() to see if the string contains " HELL " (notice the spaces within the quotes. | |
Re: One is not better or worse than the other. C is more appropriate in some applications while c++ may be better in others. It all depends on the application to be coded and the hardware on which the program will run. | |
Re: This is called CGI programs (see [URL="http://www.google.com/#hl=en&sugexp=pfwc&cp=13&gs_id=1d&xhr=t&q=cgi+c+programming&qe=Y2dpIGMgcHJvZ3JhbQ&qesig=1azR2rPTybOd4RRCDv2a9A&pkc=AFgZ2tkW17jRrzZM6jq-C-ze5JRA4bLDb7OwdILAJmlDVIKipn1OnK5FycAVD5ppyOVWaYoVUlHRvmlChz-LGDXdvZeOLVCxdg&pf=p&sclient=psy-ab&source=hp&pbx=1&oq=cgi+c+program&aq=0&aqi=g1g-v3&aql=f&gs_sm=&gs_upl=&bav=on.2,or.r_gc.r_pw.&fp=6291b3e8fb060f79&biw=1111&bih=532"]these links[/URL] for details). Your C program is installed and run on the web server. | |
Re: You will need two loops, one inside the other. The outer most loop counts the rows, then the innermost loop counts the number of starts to be printed on each row. The innermost loop will count from the 0 up to, and including the value of the outermost loop. Your … | |
Re: you can't. atoi() converts a string into an integer, has nothing to do with division. | |
Re: Did you compiler your source code for debug? Did you link with debug version of OpenCV2.1? I don't know the answer to your problem, but that would be the first things to find out. | |
![]() | ![]() |
Re: >>store_x_postions[ size] = random_x_pos; Above is incorrect -- must be (size-1) so that when size == 1 then the correct index value is 0, not 1. | |
Re: I think regex is part of [URL="http://www.boost.org/doc/libs/1_47_0/libs/regex/doc/html/index.html"]boost libraries[/URL]. | |
Re: This is the third time I've seen this same question posted by the same person. Please see my answer in your other threads and PM. | |
Re: A char in assembly is declared as db (one byte), and function 01 of int 21h (MS-DOS) returns a single character ([URL="http://spike.scu.edu.au/~barry/interrupts.html"]link here[/URL]) | |
Re: >>char reg_confirm[256]; >>reg_confirm = (char*) malloc (sizeof(char)*llSize); Its not possible to call malloc to allocate memory for reg_confirm since reg_confirm is not a pointer. Your compiler should have produced either an error or a warning about that. >>if (reg_confirm == NULL) reg_confirm will never ever be NULL because it is … | |
Re: >>error C2447: '{' : missing function header (old-style formal list?) That error usually means that you put a semicolon after the name of the function, like you did on line 31. | |
Re: First, if you want a 6-digit password then the variable must be declared as 7 characters to allow room for the null-terminator that cin will add. There are several ways to do this (and more efficient ones too), here is one of them. [code] bool flag = false; for(i = … | |
Re: What a horrible looking mess. Complete and total lack of any programming style. | |
Re: [QUOTE=vrs1155;1650609]friends i am learning visual c++ 6.0.i need to know how to connect the database(oracle).can you tell me how to do??.give me some example.... mfc application connect to oracle database,any example ??? thanking you[/QUOTE] Tutorial [URL="http://msdn.microsoft.com/en-us/library/aa315106(v=VS.60).aspx"]here[/URL] | |
Re: >> if(text[i] == ARRAY[j]) That is trying to compare an entire string with a single character. For example: [icode]if( "Hello" == 'A') [/icode] ... it just doesn't make any sense. I think what you have to do is loop through each character in text[i] to see which ones are contained … | |
Re: There are several excellent books -- [URL="http://www.amazon.com/s/ref=nb_sb_noss?url=search-alias%3Dstripbooks&field-keywords=programming&x=0&y=0#/ref=nb_sb_noss?url=search-alias%3Dstripbooks&field-keywords=programming+windows&rh=n%3A283155%2Ck%3Aprogramming+windows"]here[/URL] are a few | |
Re: have you considered just ignoring all characters after the Terminate command is received? | |
Re: If you live in USA you can get BBC America and watch Dr. Who as well as other sci-fi shows. If you don't, then you can watch them on [url]www.hulu.com[/url] or Netflex. | |
Re: If all you want is a pretty windows to show Thanks then just call MessageBox() from your console program. You don't need WinMain() to do that. | |
Re: >>I know the address (ArtMoney) I have no clue what that means. >>after all I'm here to learn Great, so start by writing your own code. [code] // put include statements here int main() { // put your code here } [/code] | |
Re: 1) You will have to post the pragma from glaux.h that is cause the problem there. 2) warnning 4996: I always disable that because it isn't really a problem [icode]#pragma warning(disable: 4996)[/icode] put that near the top of the *.cpp file 3) just ignore all those warnings you got after … | |
Re: All standard C and C++ programs are the same regardless of what platform they are compiled for. That means all of them have an [icode]int main()[/icode] function. All (or most) introduction to C programming books will be useful for either MS-Windows or *nix machines/compilers. You won't notice a difference between … | |
Re: Multiple instances of the same string literal becomes even more interesting. Some compilers have an option (switch) that allows the compiler to combine all instances of the same string literal into just one instance. So if you have coded the string "Hello" multiple times the compiler will generate just one … | |
Re: >>*(mpg+ctr) = *(miles+ctr) / *(gallons+ ctr); That's the same thing as this: [icode]mpg[ctr] = miles[ctr] / gallons[ctr];[/icode] Personally I do not like or use the pointer arithmetic as shown in your code snippet, but its just a matter of personal taste. IMO using the index method I show is a … | |
Re: >>struct clink *p. *q. That line is constructed incorrectly. [icode]struct clink *p, *q;[/icode] | |
Re: line 25 is constructed incorrectly. Should be: [icode] if( (options == 'A' ) || (options == 'a')[/icode] Notice it used || or operator, not a comma operator. Same problem with line 72. Do not use the comma operator when the || or operator is intended. | |
Re: Sounds like you are asking for inter-process communications or client/server. Yes its possible, how to do it depends on the operating system and probably the compiler. | |
Re: It's in System.Threading namespace -- [URL="http://msdn.microsoft.com/en-us/library/d00bd51t.aspx"]link here[/URL] | |
Re: [URL="http://www.gatesfoundation.org/default.htm"]Bill & Milenda Gates Foundation[/URL], like the [URL="http://www.rockfound.org/"]Rockefeller Foundation[/URL], is a corporation set up to do nothing but give money away and to make the world a better place for all of us to live in. People who are filthy rich like that have an obligation to use their welth … | |
Re: >>When and why we need to use fflush exactly? Depends on the operating system. When writing to the screen (MS-Windows) I never use fflush() because MS-Windows seems to write immediately. I have seen the problem on *nix computers where it was necessary even after putting '\n' in the output stream. … | |
Re: Happy Birthday! Actually, it isn't your brithday -- its the celebration of your birthday. You only have one birthday in your life :) | |
Re: That other engineer is wrong. [quote][URL="http://msdn.microsoft.com/en-us/library/ms682438(VS.85).aspx"]Multiple processes can have handles of the same semaphore object, enabling use of the object for interprocess synchronization[/URL][/quote] | |
Re: I got mine soon after it was legal for me to do so -- 16. That was waaaay back in 1959, and I flunked it the first time because I went through a stop sign while the cop was sitting in the passenger seat next to me. I guess I … | |
Re: delete line 17 because the memory allocation is not necessary. strstr() returns the pointer that you want to use. | |
Re: Don't be like Chicken Little who thought the sky is falling. This isn't the end of the world even as we know it. Shit happens, outbreaks like that occur frequently all over the world and the world hasn't ended yet, neither has society. Is society broken? No, it just has … | |
Re: asm programs have to be assembled with an assembler like MASM or TASM. Can't be done with VS. | |
Re: [URL="http://daweidesigns.netfirms.com/cgi-bin/pointers.php"]Here[/URL] is another tutorial on pointes | |
Re: Code::Blocks normally puts all *.h and *.cpp files in the same folder as the project itself. If you move those files somewhere else you will have to tell CB where to find them. | |
Re: [URL="http://msdn2.microsoft.com/en-us/library/e7f8y25b.aspx"]identifiers[/URL] and [URL="http://msdn2.microsoft.com/en-us/library/befeaky0.aspx"]keywords[/URL] >>Cin and cout in C++ are keywords or identifiers? look at the list of keywords in the link I provided, then you can answer this question yourself. |
The End.