345 Posted Topics
Re: Three threads. Same question. https://www.daniweb.com/programming/computer-science/threads/504440/test-scores-2 | |
Re: You already have this question in this thread. https://www.daniweb.com/programming/computer-science/threads/504440/test-scores-2 | |
Re: Line 49: Why are you returning 1 instead of 0? | |
Re: > "Flush" the stream (not recommended). > "flushing" streams can be tricky Deceptikon, Not trying to divert/hijack the thread here, but can you elaborate on this please? I've been flushing the stream after bad input for quite a while and it seems fairly straightforward. Perhaps I've been lucky. I don't … | |
Re: This isn't a C++ question, this is a Windows Explorer command line arguments question. Try opening a command line (i.e. regular old command line completely independent of your C++ program) and entering the commands you did. They will not switch drives there either. Try this to get to D:\directory1\directory2: explorer … | |
Re: Lines 39 and 40 look all right to me code-wise. You say you've checked to make sure there are not more than 80 characters in the line. Add the '\n' and the NULL terminator and that takes you to 82 characters, the size of your buffer. It might be worth … | |
Re: > The problem is that when I add elements the program automatically deletes the second element Are you sure about that? My guess is that it's just dumb luck that it deletes the second element. For example, when I ran your program, it did not do that. > and don't … | |
I'm a beginning Android Developer trying to learn the file system, etc. I'm hoping to eventually delve into Home Automation and traffic analysis using phones/GPS, but I'm in the beginning arc of this learning curve. My background is mostly C/C++, though I've done some work in Java. I'm not so … | |
Re: > fillArray has one argument, the 2D array void fillArray(int int_array) Is that how you declare a 2-dimensional array? You declared it differently in your other thread. That one has two brackets in the declaraction. Why doesn't this one? Or why doesn't the other one have no brackets like this … | |
Re: > Write only the "snippet" of C++ code for a function definition, printColumn, which prints to the console the values in a column specified by the user in the function call. void printColumn (int int_array[][], int number); > "number" is not a very descriptive term. I assume "number" is this: … | |
Re: > Product_Name is defined as an int and you are trying to assign a string to it. My C is a little rusty but it seems to me that you want to declare Product_Name as a char array and use strcpy to copy a string value to it, or declare … | |
Re: > Almost everything you do is inside the if statement. Who can tell what is in the if statement and what is not with this formatting? Certainly the OP cannot. Three opening brackets and five closing brackets if I counted right. THAT is a problem in itself. I'm with ddanbe … | |
Re: > When I enter 2 values the third one is garbage.. Not sure what you mean here. You're entering two values. What is the "third one" then? We cannot compile this since we do not have the file "Size_Decider.h". Line 22 - you are initializing integers to NULL. NULL is … | |
Re: Even if someone was inclined to do the whole thing without the slightest effort on your part and post an entire working program, that person would have to ask you to be more specific. I can think of several programs that I could write that might possibly conform to your … | |
Re: > Actually I'm surprised that you get any answer at all, considering the syntax errors in this code C/C++ gives you A LOT of rope to hang yourself with. It can be absolutely deadly. It would be nice if it would give you an error when you have no return … | |
Re: James is right, Mabdullah. The rules on this forum are pretty clear and he's following them and you're violating them. He's been here quite a while, so one would assume he knows how things work here, especially when he linked the rule he was referring to. And your program has … | |
Re: Use the sqrt function from the cmath library. That gives you a double as an answer. Assign it to an integer variable. int x = sqrt(24); // x = 4 | |
Re: There's no standard C library called pwd.h. If this is a file that YOU have written and you're using it in this project, then pwd.h should be in quotes, not brackets. #include "pwd.h" That's a slight oversimplification, but I'm guessing that's what you want. | |
Re: You have the same problem on lines 36 and 76. You have quite a few bracket problems. You have an unneeded if statement on line 65 and a comment on line 64 that seems to refer to line 67, not line 65. The indentation and code on line 74 suggests … ![]() | |
Re: I'll take a shot. I'm not as familiar as some other people, so please excuse any inarticulate phrasing regarding "reference" or "address", but hopefully it's clear enough. No for-loop is needed to print the array elements. Java provides` toString()` methods in the Arrays class. There could be a for-loop "under … | |
Re: EDIT: I am using the term "size" to denote the number of elements, including itself, that a node has in its tree. A node's "size" would be its left tree's size plus its right tree's size + one for itself. Equivalent to the term "count". Just clarifying the terminology I … | |
Re: CDS* createCDS (string filename) { ifstream inFile; int numCDS; inFile.open (filename.c_str("cds.txt")); // What does this line do? CDS** myCDS = new CDS* [numCDS]; // numCDS is uninitialized while (!inFile.eof()) { inFIle >> data; // Capitalization counts. This won't compile. What type is data? int artist; // integer? int title; // … | |
Re: Rule 1 when experimenting with operator precedence. Do one thing at a time. You have five operations going on here. They clearly aren't happening in the order you think they are. Change the line to this and see what happens: x = i + ++i; To really see what's going … | |
Re: A few comments on the Start/Stop buttons. If you press Start multiple times in a row, the clock runs faster and faster every time you press Start, so the counter increments more often than once a second, which I believe is what you intend. Perhaps check to see whether the … | |
Re: > I'm still beginner. I still learn si I ask you to help me OP, that doesn't work. I too am a "beginner" at whatever language you are using since I don't know what the language is (it doesn't get much more "beginner" than that, does it? :)) So why … | |
Re: #include <vector> #include <iostream> using namespace std; int main() { vector<double> age{8.2, 7.2, 1.3}; for(auto i:age) cout<< "Value : " << i << endl; return 0; } Not sure what you mean by "index". I think of the "indexes" as 0, 1, and 2 in this vector. The above program … | |
Re: > I think folk are downvoting because you are dumping code and not much else. Try something. Tell what line or function is giving you trouble. Yes, think about it, OP. The people helping you have to put more effort into helping you than the amount of effort that you … | |
Re: > hello guyzz i want to make a program for a personal assistant including time,date,reminder,greetings etc can anyone please help me mostly in c++ please or if not then java is also fine This is the kind of post that is almost guaranteed to not get a useful response. Pretend … | |
Re: If I am reading this correctly, the goal is to change the string "xa_55_y_*_z_/_+_x_+" to `"xa*_z_/_+_x_+"`. You want to strip out `"_55_y_"`, which is indexes 2 through 7 of the string? When you are done with the while loop on lines 23 to 31, i should equal 8 and decrementor … | |
Re: This is C code? Assuming it is and assuming cmp_str5 and cmp_str6 are both integers, this if(cmp_str5 == 0 || cmp_str6 == 0) { if(cmp_str5 == 0 || cmp_str6) would be the same as this: if(cmp_str5 == 0 || cmp_str6 == 0) { if(cmp_str5 == 0 || cmp_str6 != 0) … | |
Re: You have provided too few details for someone unfamiliar with the project to try to help you. I presume this is an assignment for a Java programming class and you've been given an assignment specification and/or skeleton code? I could guess what the functions are supposed to do and what … | |
Re: Not sure what you are trying to do, but I feel confident it isn't this: std::vector<Data obj1, info obj2> container; Perhaps you want to make a third class made up of the other two classes? class ThirdClass { Data obj1; info obj2; }; vector <ThirdClass> container; You may need to … | |
Re: Phillip, I hope you aren't expecting to get any serious answers here. You're posting in all-caps with a very vague description of some project involving human consciousness/artificial intelligence. Pretty complicated stuff. You're doing this on a forum with a bunch of strangers that you've never met. Your only other post … | |
Re: I'm calling BS that you found this "amazing code" on the internet and that you want it corrected for "thousands of coders". How about a link? Is this your code? Im also with TexWiller on this one. Plug it into your IDE and see if any errors pop up. If … | |
I have a Toshiba Satellite P55W-C running 64-bit Windows 10 Home. I bought it new less than a year ago. I am the only user. It has an Intel Core i7 CPU, 8 Gigs of RAM, 2.4 GHz. I'm generally surfing the web and streaming audio/video. I'm not a gamer … | |
Re: for (k=0;k<conter;i++) Your loop has both k and i as variables. Perhaps you wanted `k++`, not` i++`? | |
Re: >Yes, people here will help, but not many will bother to download a zip file from an unknown source! James is correct. There are potential pitfalls in downloading a zip file, unzipping it, then compiling and running it. Someone tried that on me one time with a C++ project. The … | |
Re: There are a lot of different sorting algorithms. Since you are reading in the values one at a time from user input, you start with a sorted list of one element. Given that, I would say that the Insertion Sort is your easiest approach. You have a sorted list and … | |
Re: This is a public forum. Questions should be asked and answered in the public rather than by text. It wastes everyone's time to ask them to text you. For all I know, someone has already texted you the same help that I might give, so I would spend time answering … | |
Re: > yes i didnt write it ,i just want to learn the logics bout what if i sum all the data's and find the average. ???? What "logic" is there? Just do it. As mentioned, the average is the sum divided by the count. You already have a function that … | |
Re: > Was hoping someone could help me make changes to this. I don't really want to redo the whole program. Here's what it's asking. > Write a program that allows two players to play a game of tic tac toe. Use a two-dimensional char array with three rows and three … | |
Re: > I would suggest using a class to represent a player. Possibly two classes: player and board. That'd be my approach probably. However, we don't know the OP's background. I'm thinking that, judging from the code, they have not gotten to classes yet, so that's probably not an option. To … | |
Re: > I am trying to add an int to a Multi-dimensional char Array. You don't have a multidimensional char array. You have a multidimensional array of `char*` which you don't want here. Take the asterisk out of line 10 and you'll have a multidimensional character buffer big enough to hold … | |
Re: What language are you using? It's hard to give advice without knowing more details and without seeing some code. You have a file. You want to read the relevant information from that file and store that data in RAM so you can then display that data onto a graph, which … | |
Re: In general, not specifically looking at the code itself much, but more looking at the approach/debugging process, a few points: > **"Also, when it comes to deleting the last node, the program kept running infinite. I tried to add system pause or break but nothing works."** > **"the program kept … |
The End.