345 Posted Topics

Member Avatar for crazyninja247

Three threads. Same question. https://www.daniweb.com/programming/computer-science/threads/504440/test-scores-2

Member Avatar for AssertNull
-2
78
Member Avatar for crazyninja247

You already have this question in this thread. https://www.daniweb.com/programming/computer-science/threads/504440/test-scores-2

Member Avatar for AssertNull
-1
76
Member Avatar for can-mohan
Member Avatar for mabdullah4

> "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 …

Member Avatar for AssertNull
0
3K
Member Avatar for mabdullah4

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 …

Member Avatar for AssertNull
0
360
Member Avatar for JohnMcPherson

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 …

Member Avatar for AssertNull
0
3K
Member Avatar for n00b321

> 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 …

Member Avatar for n00b321
0
9K
Member Avatar for AssertNull

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 …

Member Avatar for rproffitt
0
374
Member Avatar for poloblue64

> 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 …

Member Avatar for David W
0
560
Member Avatar for poloblue64

> 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: …

Member Avatar for David W
0
325
Member Avatar for AKRAM83

> 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 …

Member Avatar for mabdullah4
0
239
Member Avatar for Kachour

> 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 …

Member Avatar for AssertNull
-1
330
Member Avatar for mabdullah4

> 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 …

Member Avatar for AssertNull
0
210
Member Avatar for akdser6

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 …

Member Avatar for mabdullah4
0
121
Member Avatar for selfTaughtCPP

> 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 …

Member Avatar for tinstaafl
0
183
Member Avatar for pauline.zorilla

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 …

Member Avatar for AssertNull
-2
133
Member Avatar for Muhammad Arslan_1

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

Member Avatar for mabdullah4
0
196
Member Avatar for gugushe

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.

Member Avatar for AssertNull
0
227
Member Avatar for Kaleena

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 …

Member Avatar for RudyM
0
344
Member Avatar for Riya@23

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 …

Member Avatar for JamesCherrill
0
1K
Member Avatar for Roger_2

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 …

Member Avatar for AssertNull
0
1K
Member Avatar for HugeTeddyMonser

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; // …

Member Avatar for AssertNull
0
178
Member Avatar for CodyOebel

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 …

Member Avatar for AssertNull
0
484
Member Avatar for Mickey_2

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 …

Member Avatar for Mickey_2
0
293
Member Avatar for ardywijaya1997

> 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 …

Member Avatar for AssertNull
-1
343
Member Avatar for Ding_1

#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 …

Member Avatar for AssertNull
0
165
Member Avatar for ardywijaya1997

> 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 …

Member Avatar for AssertNull
-2
372
Member Avatar for Yashwant_1

> 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 …

Member Avatar for AssertNull
0
157
Member Avatar for COKEDUDE

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 …

Member Avatar for AssertNull
0
261
Member Avatar for COKEDUDE

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) …

Member Avatar for Reverend Jim
0
178
Member Avatar for nadiam

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 …

Member Avatar for AssertNull
0
252
Member Avatar for prahesh

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 …

Member Avatar for prahesh
0
306
Member Avatar for Phillip_3
Re: AI

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 …

Member Avatar for Suzie999
0
172
Member Avatar for sashiksu

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 …

Member Avatar for hericles
0
195
Member Avatar for AssertNull

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 …

Member Avatar for AssertNull
0
384
Member Avatar for humble55

for (k=0;k<conter;i++) Your loop has both k and i as variables. Perhaps you wanted `k++`, not` i++`?

Member Avatar for AssertNull
0
731
Member Avatar for Jendalin23

>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 …

Member Avatar for AssertNull
-1
633
Member Avatar for Vlatko_1

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 …

Member Avatar for AssertNull
0
250
Member Avatar for ravikishorerk19

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 …

Member Avatar for rubberman
-1
154
Member Avatar for Gede_1

> 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 …

Member Avatar for AssertNull
0
6K
Member Avatar for thekid772

> 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 …

Member Avatar for AssertNull
0
289
Member Avatar for xcp3

> 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 …

Member Avatar for AssertNull
0
313
Member Avatar for COKEDUDE

> 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 …

Member Avatar for AssertNull
0
323
Member Avatar for Sanfu

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 …

Member Avatar for AssertNull
0
488
Member Avatar for blacklune

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 …

Member Avatar for AssertNull
0
285

The End.