1,358 Posted Topics
Re: [URL="http://www.daniweb.com/forums/announcement8-2.html"]So what have you done so far?[/URL] | |
Re: I believe you have an extraneous comma before the WHERE in your query, but you don't have any error-checking. To help correct this, add [CODE]if (!$result) { die("Unable to update table ".mysql_error($conn)); }[/CODE] after line 16. See if that tells you anything. Then report back | |
Re: Your $x is a string, you should really have it be an integer. Then, all you would have to do is divide by 100. If you need a string for some reason, you could try to use intval() to extract an integer value from the string. You still would have … | |
A couple days ago, I was involved in [URL="http://www.daniweb.com/forums/thread258996.html"]this thread[/URL] which concerns bit shifting (kind of) and a solution was found (by someone else). The problem is, something about the solution never really sat right with me. Hopefully someone can clarify this for me. [B]Code:[/B] The code uses 1 constant … | |
Re: You could try using an if statement with the loop's counter and the mod operator (%) to break it up into n rows of x columns. [code] const int ROW_SIZE = 5; for (int i = 0; 1 <= 20; i++) { /* read input */ /* write output */ … | |
Re: [QUOTE=DJPlayer;1128280]this is for a C program.. not C++. I posted in here because I was gonna build in C then transform.. so I doubt I can use stringstream.. =/ ugh[/QUOTE] You won't have much luck with this in C. Everything you've done so far is based on C++. C is … | |
Re: You should be able to just output to the console then copy from there... Or, write it to a txt file then copy it from there... Substantially less effort than interacting with a window. | |
Re: [QUOTE=eternaloptimist;1128137]i have a few questions.: 1)if i wanted to write a line of code needed to declare a 1-dimensional array named names that can hold 8 string values would this be correct?: char names[8];[/quote] char names[8] would not do what you want. That would create an 8-element array with each … | |
Re: [URL="http://www.daniweb.com/forums/announcement8-2.html"]This might help.[/URL] [URL="http://www.lmgtfy.com/?q=SRC+Assembly"]This might help too.[/URL] | |
Re: [URL="http://www.daniweb.com/forums/announcement8-2.html"]Good luck with that.[/URL] Let us know when you decide not to cheat. Maybe we can help then. Grrr.....You're lucky I goofed on the rep button... | |
Re: Kudos for an excellent first post :cool: Are the "isAlive" functions static? I think you may be referencing them incorrectly when you call them in your conditionals. It seems like the compiler would have thrown an error though... Also, is there a reason for all 6 *List.erase() lines being commented? … | |
Re: int main() is the required format under the ANSI/ISO standards. If you return anything but an int, it can lead to system issues. Some compilers will even complain if you try to return anything but an int. As far as value is concerned, zero (0) is considered the "universal" success … | |
Re: If you continue to ignore people, you'll get more -rep. Read jonsca's posts again. A big part of your answer is right there staring you in the face. Check your use of single vs. double quotes. Edit: nvm... I missed posts 11, 12 while catching up. | |
Re: You don't have to post the personal information contained within the comment block(s), omit that part when you post your code. That's an issue that is pretty simple to figure out. It is important to be clear, which you have been. But without the code, all the clarity in the … | |
Re: What does your output look like now? That will help steer you in the right direction. Ask yourself "What statement can I move where to make this look right?" Or possibly, "What extra statement do I need to add to make this look different?" | |
Re: [QUOTE=JasonHippy;1125534]...shifting x by 32 places in either direction will give you x![/QUOTE] I don't think this is correct. I'll admit, I'm still figuring out bitwise operators myself, but last I knew they don't wrap around. (Still looking for reference where I read it.) The way I understand it is if … | |
Re: Your post is confusing me. Do you have the actual dll or did you simply download and #include the header for it? I'm sure you know it, but you need both... | |
Re: Perform a select query to look up the movie. If a record is returned, it already exists. Once you know if the record exists, or not, you can then either report an error condition or perform the insert. | |
Re: Have you tried using string concatenation to build the query before you send it? [code] string NewMovie, queryText; cout << "Enter the title of a movie: "; getline(cin, NewMovie); /*use getline() instead of cin >> because some movies have more than 1 word in name cin >> breaks input stream … | |
Re: 1.) [URL="http://www.catb.org/~esr/faqs/smart-questions.html"]Read this.[/URL] 2.) Answer these: [INDENT]A.) What are you trying to accomplish? We can't help if we don't know that. B.) What are the errors you are getting? Again, can't help if we don't know. C.) Why is there a '}' on line 1? What is the scope that … | |
Re: [QUOTE=rbregs;1125446]can you make an infinite program using do while loop??[/QUOTE] You can make an infinite loop with any loop structure, it just depends on how you write it... @OP: According to [URL="http://www.cplusplus.com/reference/string/getline/"]this article[/URL], getline has a default delimiter of '\n' that it detects and discards. The issue may be that … | |
Re: First, I would like to emphasize that program lines don't change. What changes is [U]the information contained within the variables[/U] used/defined by those lines. Your code tells the computer how to use and change that [u]information[/u]. Second, I think it might be advisable for you to read some tutorials: [URL="http://www.cplusplus.com/doc/tutorial/functions/"]Functions[/URL] … | |
Re: [QUOTE=arithehun;1122152]I am trying to create an expression evaluator to expand my C++ knowledge. It is supposed to evaluate 5(x+7)-2. Here is the code: [code=c] #include <iostream> #include <stdio.h> #include <time.h> using namespace std; time_t now, later; void sleep(int delay) { now=time(NULL); later=now+delay; while(now<=later)now=time(NULL); } int main(void){ //It finds an error … | |
Re: I can't help with your settings. But I have a couple questions that may help. Obviously, I don't know your machine's performance specs, but it could be an issue with your machine's performance. Have you tried running the exe on a different machine to see what happens? This could help … | |
Re: Will type casts work? i.e. [icode][b](const char *)[/b]results.st_size[/icode] This should enable it to compile, but honestly, I suspect you'll get invalid results. | |
Re: [QUOTE]I use MS VC++6 and when I type code I have problem...let's say I have 123456789 typed and I place cursor between 4 and 5 and than type "something" I get 1234something and not 1234something56789[/QUOTE] Sounds like you're in overwrite mode instead of insert mode, hit your [insert] key. The … | |
Re: Umm.... this thread is 7 years old. Why did you res it just to say thanks to someone that wasn't even talking to you? An unfortunate waste of a first post... | |
Re: I have VS 2008 as well (not quite as much experience, but oh well). One of the first things I noticed about 'watch'es is that sometimes even though a variable's name and information are in-scope, the copy of it that you are looking at may not be. You actually need … | |
Re: I have concerns related to this (it's probably nothing though): [CODE=c++]//at the end delete[] arr[0]; delete[] arr[1];[/CODE] I'm not too sure it will work correctly. Reason: Since an array technically is just a pointer to the first element of the array, won't you lose access to your whole array if … | |
Re: It's an inherited member. You can't initialize an inherited member in a local constructor's initialization list because the inherited members don't exist yet. If there is any initialization you need to do to an inherited member, you will either need to do it in the inherited object's constructor or in … | |
Re: [QUOTE=ayushii;1119863]plsssssssss help me guys ..... i want a c++ code for arithmetic & scientific calculators individually,..... plsss help... i need it within a few days.......plsssssss[/QUOTE] This thread was started by someone else for a completely unrelated topic: 1. don't thread hijack, 2. read the forum rules, we refuse to do … | |
Re: I am not familiar with Code::Blocks but several other members here seem to like it. If you are running Windows, I know that MS-VC++ is capable of doing everything you mentioned. Stay away from Dev-C++, its debugger leaves something to be desired. I have no idea about Unix or Linux … | |
Re: [QUOTE=ployer;1118975][B]Oh and the Arrow designator "->" is for referencing a method or property of an object, much like the "." in Java or C#.[/B] It can also be used to denote a pointer. Incase you are wondering as well when you see the "&" infront of a variable name that … | |
Re: I would store the files in a location easily accessible from both projects then include them in the project(s) respective solutions... Unless you're trying to make a DLL or something, then I can't help you... | |
Re: Are your header files macro-protected? [url=http://www.daniweb.com/forums/post1114822.html#post1114822]Clicky[/url] | |
Re: It sounds like you are simply calling the function and having it output to the browser which is not sufficient. You need to use the DOM and update the appropriate nodes through AJAX. If you're not familiar with the DOM and AJAX [url=http://www.w3schools.com/ajax/default.asp]click here[/url]. | |
Re: Can you do something with an if then ladder that marks the beginning of each month similar to a grade calculation? [code=c++] /* for grading scale */ char grade; int score; if (score > 90) grade = 'A'; if (score > 80) grade = 'B'; /* ...etc... */ [/code] Then … | |
Re: First things first, on lines 21, 25, 26... where did 'a[]' and 'i' come from??? Did you define them elsewhere? Are they properly initialized? Second, why can't you just put an accumulator in your for loop then put the appropriate cout after the loop? Based on the segment you posted, … | |
Re: [quote=m_adeelkhan;1118059]>...i donot ask u to write code for me ...[/QUOTE] Yes you did... [QUOTE=m_adeelkhan;1117132][B]>>...if some 1 can share code it will be quite help full 4 me[/B][/quote] [QUOTE=m_adeelkhan;1118059]...already make a code that was working properly on 3x3 board but not on 7x7 on 7x7 it work properly as human vs … | |
Re: In the case of a class, you could do it within the constructor(s) as well if you don't want it static. Header: [code=c++] class example { private: int someVar; public: example(); /* default constructor */ example(int);/* overloaded constructor */ }; [/code] Implementation file: [code=c++] example::example(){ /* default constructor */ someVar … | |
Re: Why not store everything up to the '.' in one array, then everything after it in another array or a switch-controlled set of string literals? That way you can just use the program logic to output the file name then decide which extension to output... Or am I missing something? … | |
Re: Just like any other database access, build a form then process the form. While you're processing the form build a query to 'UPDATE' the user's information in your database table. | |
Re: The OP's original question was already answered in [url=http://www.daniweb.com/forums/thread256949.html]this thread[/url]. But I think I need to address this: [QUOTE=hermann87;1117803]Try using the [B]this[/B] operator for your class variables to avoid confusion as you seem to be using a type String variable named kind in both your class and your main program. … | |
Re: You are trying to use a default constructor without having a default constructor defined. EDIT: Part of your issue before was that you had an "overloaded" constructor but no default constructor, which normally isn't a good thing. It seems that it still thinks there isn't one. /EDIT: I suggest you … | |
Re: [QUOTE=mmasny;1117763]What is the public inheritance?[/QUOTE] C++ has 3 levels of inheritance (private, protected, and public). Although they are partially-related, these do not have the same meaning as the internal access levels within a class. Think of this version as meaning "the members of the base class will be shifted so … | |
Re: It's only been 25-mins. This is a forum, you can't expect immediate help. Consider yourself lucky I'm even posting. As far as your code goes, WTF are you trying to accomplish? All I'm seeing is a bunch of screwing around to assign an input to an array element. Why not … | |
Re: [QUOTE=cpu-guy;1115758]what does iterative version mean?[/QUOTE] It means that it's a demo, but not the answer you need. "This is what you need to accomplish, but a different way." You need a recursive version. | |
Re: 1.) Use code tags, Narue said something to you already 2.) y=f/2; if ( y= 0) cout<<"even"; else cout<<" odd"; is not even close. According to this code (if it were actually written correctly), the only even number that exists is '0'. First, you need to use the modulus operator … | |
Re: Your information is a little vague. Are you getting compiler errors or is the program simply not behaving as intended? Regardless, these are my thoughts: [code=c++]class tropicalfruit //Class tropicalfruit { public: string name; double price; };[/code] This isn't a bad idea. Using public data members is not generally recommended practice … | |
Re: [QUOTE=adnan.siddique;1115073]You should not tell him the solution. That is wrong[/QUOTE] I'm guilty of the mistake too, but that is the OP posting what they came up with after your comments. Their wording could have been much less snooty though. |
The End.