3,183 Posted Topics
Re: > I have unfortunately installed a fake copy of xp Then unfortunately you should uninstall the pirated copy, buy a legit copy, and install that. > the microsoft co-operation has tracked it and the screen display has turned upside down That's utterly ridiculous. I don't doubt that you've accidentally hit … | |
Re: [Click Here](http://lmgtfy.com/?q=objective+c+tutorial) | |
![]() | Re: > Anybody got any views on this? Is common civility something to be shunned in order to avoid offence? I was raised to be polite and courteous to all, women and men regardless of age. If someone is offended by that, it's not my problem. If a woman gets offended … |
Re: > i have not defined <stdlib.h> header and included rand() function and it works without this header. How? If you don't declare a function before using it, the compiler will assume that it's an external function accepting an unknown number of arguments and returning int. If those assumptions hold true, … | |
Re: You're trying to concatenate to a variable that was never truly given an initial value. Somewhere before the first concatenation, add this: $topic = ''; | |
Re: > I'm not able to duplicate this. Zoom out by one tick (hold down ctrl then hit '-'). It happens in Chrome and Firefox, but not Opera or IE. | |
Re: Your push_in_tree() function has no way of telling the caller what changed. Consider this: EL *push_in_tree(EL *new_ptr, EL *root) { if (root == NULL) { root = new_ptr; } else if (new_ptr->id < root->id) { root->left = push_in_tree(new_ptr, root->left); } else { root->right = push_in_tree(new_ptr, root->right); } return root; } … | |
Re: > its ok u cant help. It's not a matter of "can't". We *won't* help when you're looking for a handout. The sad part is that not only did you steal the posted code to trick people into believing you did *any* work (which you clearly did not), you stole … | |
Re: My educated guess is that you're using Turbo C to run this program. Turbo C's int is 2 bytes rather than 4, so 34545666 is *waaay* out of range. Use a long int instead of int to ensure that the code works even on ancient compilers or compilers that target … | |
Re: Please post a sample program that exhibits the problem. | |
Re: for i in range(0, n): List.append(random.randint(0,1000)) return (List) This generates one number, appends that one number, and returns immediately on the first iteration of the loop. You need to move the return statement outside of the loop: for i in range(0, n): List.append(random.randint(0,1000)) return (List) | |
Re: > However java does not seem to allow 2 returns in the same method That's not correct. > and considers the following code as not having a return statement. This *is* correct. Not all paths end in a return statement, so your compiler is complaining. You have a return for … | |
Re: Double check your use of semicolons. You have a bunch of them where they shouldn't be. | |
Re: > `fp1=fopen("**********.CPP.SAVE","w"); ` This is a little confusing, are you trying to use wildcards or placeholders to pick up any file matching that pattern? If so, fopen() doesn't do that. *If* it happens, that would be an extension provided by your compiler that you need to confirm rather than asking … | |
Re: strcmp() returns a comparison, not equality. If the result is 0, the two strings match. If the result is less than 0 the first string is lexicographically smaller, and if the result is greater than 0 the first string is lexicographically larger. So your test should look like this: if … | |
Re: > method expects address of the variable/ pointer varible instead of passsing value of the variable while calling the method > but you called this method by passing the value directly so that is the reason you got skipping over the function call That's a good guess, but you're wrong. … | |
Re: It's very difficult to suggest anything useful due to the incredibly vague nature of the question and lack of code. | |
Re: > I was also told to stay away from classes completly until he's ready for me to move in that direction. That sounds like the kind of thing a teacher who's only a step or two ahead of you in the learning process would say to avoid being embarrassed. | |
Re: Where are you storing the information and what are you planning on doing with it? How you store it will change depending on what your needs are in terms of how the data is used. > Basically that; Im thinking about a 3 demensional array. Would this be correct? Unless … ![]() | |
Re: > how exactly I write that there is 2 parameters should be entered by the member? or just click the search button? I'd break the logic down like this: If NOT empty(course_id) search_exact(course_id) Else If NOT empty(course_name) search_fuzzy(course_name) Else list_all() If there's a course ID, it's safe to assume that … | |
Re: > What should i do to handle this exception. Don't cause it in the first place. If values can be null, be sure to check for null when doing things like output and use a safe alternative. | |
Re: The logical OR (`||`) and bitwise OR (`|`) are also subtly different. Sometimes you'll get the same result and sometimes you'll be surprised, so I'd recommend not using the bitwise OR in situations where you clearly want a logical OR. This is one of those situations, so your test should … | |
Re: Any motherboard will support Windows Vista. All of those stickers saying "Vista Compatible" or "Vista Ready" are just marketing BS. The components you need to ensure are up to spec are the CPU, the video card, hard drive size, and the amount of RAM. Those are all listed under the … | |
Re: > When a simple-escape-sequence like '\n' is evaluated, what would be the result? It's evaluated as the platform-dependent character for a newline. For example, on Linux '\n' will be evaluated as LF (ASCII 10) while on Windows it'll be evaluated as CRLF (ASCII 13 + ASCII 10). But it's totally … | |
Re: As an avid avatar junkie, why would you want to have the same avatar on different forums? ;) Just kidding, it's a nice idea. I'd actually never heard of Gravatar though, so I'd have to look into it. There's also the niggling worry about using plugins to off-site storage that … | |
Re: > I have yet to effectively use these expressions. It's fairly straightforward when compared with an if..else statement. This: x = (condition) ? foo : bar; Becomes this: if (condition) { x = foo; } else { x = bar; } IF you don't need to make an assignment and … | |
Re: Even if what you want was trivial enough to post in a reply (it's not, by the way), we don't give homework help without proof of effort. Please read our rules, [definitely read this](http://www.catb.org/esr/faqs/smart-questions.html), and try again. | |
Re: It really depends somewhat on how you declare your pointer. For example, a static or global pointer will be default initialized to null. A local pointer will contain random garbage if not explicitly initialized, just like any other local variable. Best practice is to initialize your variables in all cases … | |
The annoying use case is this: for (vector<int>::size_type i = 0; i < v.size(); i++) { cout << v[i] << ' '; if (i == v.size() - 1) { cout << endl; } } C++11 offers the `auto` keyword for initializer type deduction so that we can avoid verbose and … | |
Re: Quote your string in the SQL statement: string OrdersLine50CustomerSQL = "SELECT cashID, cashQTY, cashDescription, cashSupplier, cashDate, cashCost, cashSell, accAccRef_FKID from cashOrders WHERE cashOrders.accAccRef_FKID = '" + CustomerID.ToString() + "'"; | |
Re: I'm not sure I understand the requirement. You want to clear the Excel workbook *before* uploading it to the database? That sounds like a no-op, since the upload on an empty file will do nothing. Perhaps you mean clear the file *after* uploading? But if that's the case, why not … | |
Re: You haven't provided enough information. What kind of data? Who needs access to the data? How is the data accessed? How much of it needs to be accessible at any given time? What does "large amount" really mean? Is this online hosting service just for storage (such as a cloud … | |
Re: > So in the following code, is message an array because it doesn't really look like one? Yes. The string literal is actually stored as and has a type of **array to const char**. When used in value context it evaluates to a pointer to the first element, which is … | |
![]() | Re: Define a property in Form2 that will hold that string, then assign to it and refresh()/invalidate() the control in Form2 whenever you want (ex. in the validated event of the textbox in Form1). For example, in Form2: public string MyText { get { return textBox1.Text; } set { textBox1.Text = … |
Re: > file_to_check.close(); That's not necessary. If the file is open, the destructor for ifstream will close it. | |
Re: Have you considered running Fedora in a VM? If all you need is a \*nix system for the shell programming class, that strikes me as the better option than completely wiping your laptop and installing an OS that you may not use for longer than a few months. | |
Re: I'm assuming that clever replacements for string.Split() are off the table too. Try looping over the characters in the string and print a newline when you reach whitespace: foreach (char c in s) { if (!char.IsWhiteSpace(c)) { Console.Write(c); } else { Console.WriteLine(); } } That's the simplest approach, but it … | |
Re: Falling off the end of a function doesn't return anything meaningful. What you want is to return the result of the recursion (see line 13): public static bool FindTarget(int target, int[] arr, int index) { if (index >= arr.Length-1) { return false; } if (arr[index] == target) { return true; … | |
Re: > It needs to print out signBit, expBit, and fracBits. What, pray tell, are expBit and fracBits supposed to represent for an integer? | |
Re: > 1) Leave the explanation of what a function does outside the function, and the comments about how it is done inside the function, near the code that does it. I'd go even further (since I'm a sparse commenter) and say that comments should be limited to the following (examples … | |
Re: Please read our rules concerning homework problems. You've failed to provide sufficient proof of effort. | |
Re: Why do you keep starting new threads for the same program? Please stick to one thread unless the questions are wildly different. | |
Re: > Yup, but that implies I have to convert it from a date format to a string then convert it back. Nope, you just need to convert it to a string since you already have a valid DateTime object: string formattedDate = dateOfBirthUpdate.DateOfBirth.ToString("yyyy-MM-dd"); | |
Re: > I would like to write a little program that is a little floating window, that can be viewed on both the "Metro" screen and on the desktop, is this possible? As I understand, Metro doesn't support any kind of windowing system that would give you something "floating", it's all … | |
Re: > My program runs but I feel like it is missing something else. Yes, you're missing the subroutine. Declaring a function is only half of process, you also need to define the function and tell it how it works: #include <iostream> using namespace std; // Declaration: Tells the compiler how … | |
Re: > so how connectivity of oracle is possible with c++? Start by googling for an oracle database library that supports your old as dirt compiler. Then read the documentation and tutorials for that library, and you'll be in a much better position to do your project. | |
Re: Actually, Daniweb supports both changing of names (it's a one time change per account) *and* deleting of accounts. Either of those can be done from [here](http://www.daniweb.com/members/edit_membership). | |
Re: The == operator is used for comparison, it's different from the = operator which is used for assignment. Also, it may seem confusing at first, but you *don't* end the line of an `if` statement with a semicolon. It's legal, but doesn't do what you want. Simple statements *do* end … | |
Re: Try using a regular expression to replace multiple instances of CRLF and newline with a single instance. You probably also want to consider including break tags: // Squeeze break tags $comment = preg_replace('/(<br\s*\/>)+/', '<br />', $comment); // Squeeze CRLF $comment = preg_replace('/(\r\n)+/', '\r\n', $comment); // Squeeze NL $comment = preg_replace('/(\n)+/', … |
The End.