1,359 Posted Topics

Member Avatar for ashley.vanhoesen.7

Let's see if you can determine the problems with these two lines: void copy() and return (x +1); then figure out what it implies for copy() (Bonus points if you can see the syntax error in that last line.)

Member Avatar for NathanOliver
0
1K
Member Avatar for TheFearful

Has the instructor covered dynamic memory allocation (`new` and `delete`) yet?

Member Avatar for Schol-R-LEA
0
321
Member Avatar for Labdabeta

If output alone were your goal, I would say to use an `ostream` for the variable class and `ofstream` for the output file. However, you are then using the file for input, which does indeed lead to the problem you describe. Wait, what is the goal, here? Why would you …

Member Avatar for Labdabeta
1
574
Member Avatar for Michal_3

Woooee's advice is spot on, as far as it goes. However, if you are trying to repeat something without knowing how many times to repeat it, what you would want is a `while:` loop. pagechoice = '1' while pagechoice != '0': pagechoice = input("Please choose one:") #Now it will determine …

Member Avatar for Schol-R-LEA
0
2K
Member Avatar for Sreya_1

I would actually recommend [Gnome Sort](http://en.wikipedia.org/wiki/Gnome_sort), as it is a little smaller marginally faster than Bubble Sort, though it is a little harder to understand. The main reason bubble sort is such a topic of fascination for computer scientists is that it appears to be the 'naive' algorithm for sorting, …

Member Avatar for Banfa
0
146
Member Avatar for nitish.mohiputlall

in the line in question: sum[M][3] = inputarray[M][3] + inputarray2[M][3]; You are treating `inputarray()` and `inputarray2()` as arrays, rather than calling them as functions. The correct syntax would be: sum[M][3] = inputarray(M, 3) + inputarray2(M, 3); BTW, I strongly recommend you get into the practice of indenting your code suitably. …

Member Avatar for Schol-R-LEA
0
2K
Member Avatar for rodion.gorkovenko

I think you'll find a purely functional sub-set of [Scheme](http://en.wikipedia.org/wiki/Scheme_%28programming_language%29) sufficiently simple for you needs. It is famously easy to implement in a short program, and requires relatively few resources (mainly, some form of garbage collection or reference counting - the latter of which PHP already supports IIRC). Several online …

Member Avatar for Schol-R-LEA
0
360
Member Avatar for john.kane.100483

Because each digit in an octal value is equal to three bits of binary, and each hex digit is equal to four bits. The higher the base, the more compact the representation. This is related to why decimal doesn't suit many purposes in computer mathematics - base 10 doesn't line …

Member Avatar for David W
0
182
Member Avatar for LucyLogic

It would help a lot if you told us what was going wrong; while we can surmise a lot from the code, to be as accurate as possible, we would need to know the exact error messages you are getting. That having been said, I can see three major problems, …

Member Avatar for David W
0
3K
Member Avatar for oanahmed

What you need to see here is that the 'decimal equivalent' is actually a string of characters, for which there may be (in the case of a 64-bit two's-complement integer representation) 19 digits and a sign to represent. Depending on the character encoding, this may mean as much as 80 …

Member Avatar for mike_2000_17
0
298
Member Avatar for john.kane.100483

Unfortunately, you still aren't indenting your code, making it virtually impossible to read the program. Allow me to (once again) run your code through [Astyle](http://astyle.sourceforge.net/) and format it sensibly: #include<iostream.h> #include<conio.h> #include<stdio.h> char value; char t, u, v; char answer; void Binary2Decimal() { gotoxy(1,13); printf("[BINARY TO DECIMAL CONVERSION]"); long b2,f2=1,d2=0; …

Member Avatar for David W
0
1K
Member Avatar for aronno.amin
Re: c++

A commendable ambition, I suppose, though I would personally recommend aiming a little lower to start with - C++ is a tremendously complicated language and IMAO not well suited for beginners. Learning a simpler programming language such as Python would be advisable as a start. Indeed, you would probably go …

Member Avatar for panqnik
0
176
Member Avatar for Sara Masri

OK, so what you actually need is a *[lexical analyzer](http://en.wikipedia.org/wiki/Lexical_analysis)*, also called a *tokenizer* from it's main mode of operation, which is to break a stream of characters into tokens. There are several discussions of this topic on DaniWeb, if you do a search on 'tokenizer'. You might want to …

Member Avatar for Ancient Dragon
0
190
Member Avatar for damte38

A base class (or parent class, or superclass) is a class which one or more child classes inherits from; a child class (or sub-class) is one which inherits from a base class. Depending on the language, you may have some programmer-defined classes which have no base classes, or (more often) …

Member Avatar for Schol-R-LEA
0
79
Member Avatar for mary.fatulalohr

The primary thing that leaps out at me is that you dropped the left brace on line 5.

Member Avatar for David W
0
162
Member Avatar for neha.jebin.18

It shouldn't be necessary to do so, but it might help put the class in context. Posting the error log would probably be more helpful, in this case, especially since I was able to compile the code (with the open brace restored and the c'tor name corrected) with no trouble …

Member Avatar for David W
0
267
Member Avatar for john.kane.100483

If you look down the C++ forum page to the [previous thread](http://www.daniweb.com/software-development/cpp/threads/474555/corrections-turbo-c-conversion), you'll see that I gave a detailed answer already. Would you do us all a favor and **not** create a new thread each time you log in? It is much easier for everyone if you continue the existing …

Member Avatar for john.kane.100483
0
149
Member Avatar for Sara Masri

As I explained in my previous response, what you are trying to write is a lexical analyzer. I gave links to some helpful posts and resources in that post that you should have gone over by now. No one here is going to write this program for you. We can …

Member Avatar for rubberman
0
314
Member Avatar for john.kane.100483

> My prof said that she will not accept my program because she said that cout,cin & etc... are not allowed use only the older style.. Hold on for a moment. Is this a course in C++, or in C? Most C++ compilers (including Turbo C++) will also compile C …

Member Avatar for Schol-R-LEA
0
228
Member Avatar for john.kane.100483

While it is unfortunate that it took so long for one of us to get back to you, you have to understand that this can and often does happen on these fora; we are doing this on a volunteer basis, and there isn't always someone able or willing to answer …

Member Avatar for Schol-R-LEA
0
251
Member Avatar for glamiex

Well, the first part (display user instructions) seems straightforward; simply write a function that displays the instruction message. While you can probably hard-code the instructions and get credit for it, I would recommend storing them in a data file which the program can read at initialization. BTW, part four is …

Member Avatar for Schol-R-LEA
0
790
Member Avatar for MasterHacker110

There are actually a number of them out there, at least two of which are actually called 'NASM-IDE'. The more familiar one is probably [url=http://www.nasmide.co.nr/]this one[/url], though it has it's problems - many people dislike it for it's flakiness. Another popular choice is [url=http://www.oby.ro/rad_asm/]RadASM[/url], which is said to have excellent …

Member Avatar for Дмитрий_4
0
2K
Member Avatar for d100man

The problem seems to be the simplest of all: in the `if()` statement, you compare `sex` to `"F"` (capital F) instead of `"f"` (lowercase f). This can be solved simply by changing the character being compared, though I would actually recommend a more general solution, by forcing the characters to …

Member Avatar for Schol-R-LEA
0
111
Member Avatar for 21345570

OK, as an aside, what is with these '213xxxxx' usernames? Is this one person creating multiple accounts, or are these student IDs all from a single school, or what?

Member Avatar for 21345572
0
147
Member Avatar for rithish

In addition to what Deceiptikon and sepp2k said, I would add that it yu've declared the function as returning an `int` value, but at no point to you actually return one. There is actually a much simpler way to do this, one which takes only the starting value as an …

Member Avatar for Reverend Jim
0
154
Member Avatar for 21345572

In essence, a [lambda expression](http://en.wikipedia.org/wiki/Lambda_%28programming%29) is an anonymous function, which can be used in a context where a regular named function could be used, but where the function in question exists for a single purpose and thus should not be given a name (to avoid using up the namespace). They …

Member Avatar for Schol-R-LEA
0
161
Member Avatar for beauty.is.raven

We can start by explaining how to post code in this forum correctly, and while we're at it, how to format Java code according to the usual conventions. The forum software does not, by default, retain indentation; in order to post code samples, you need to indent the code by …

Member Avatar for jwenting
0
404
Member Avatar for Nicholas_1

In C/C++, command-line arguments (AKA shell arguments) are passed through optional parameters to the `main()` function. These parameters, by convention named `argc` and `argv`, are an integer count of the arguments passed to it, and a pointer to an array of `char` arrays, which hold the string values of the …

Member Avatar for Schol-R-LEA
0
174
Member Avatar for shyrin
Re: c+++

First off, we don't do other people's homework for them. Second, we *don't* do other people's homework for them. And third, ***we don't do other people's homework for them***. Sensing a pattern here yet? No one here will simply hand you a solution on a silver platter. If you show …

Member Avatar for Schol-R-LEA
0
158
Member Avatar for C-Money

Could you please tell us what system or emulator you are using? There are small but sometimes important differences in the way different emulators (e.g., SPIM, MARS) work, especially in terms of the assembly directives they accept, and it may be relevant. For now, I'll assume you are using SPIM, …

Member Avatar for Schol-R-LEA
0
5K
Member Avatar for Wilever

What, if anything, do you have already? I would recommend starting with a simple function that takes a Celsius value and returns the Fahrenheit equivalent. If you don't know how to write a function, let us know and we'll explain it for you.

Member Avatar for Greg_4
0
16K
Member Avatar for simplysach

It would be impossible for us to tell you how to describe a lesson we haven't seen ourselves. I can make a few guesses on things, but I can't be certain they are correct. * I think you have the relationship between Raspberry Ï€ and the Python language interpreter reversed. …

Member Avatar for Schol-R-LEA
0
327
Member Avatar for Za3mi

As sheikh.islampollob said, the language that you use to implement the project is less relevant to the solution than the design of the program is. One thing I will tell you right now is that the project as described will take more than a month to finish correctly; indeed, if …

Member Avatar for Schol-R-LEA
0
206
Member Avatar for glao

Hold on for a moment, here. Is this supposed to be a C++ program, or a C program? While most C code is also valid C++, as a rule in C++ you want to avoid using certain C idioms and functions, with `malloc()`, `free()` and the standard C I/O functions …

Member Avatar for glao
0
330
Member Avatar for tadas.bareikis

If you are of a mathematical bent, you might try the exercises on [Project Euler](https://projecteuler.net/).

Member Avatar for Schol-R-LEA
0
205
Member Avatar for leonardo.hieu

The two errors you mention come from the same source: line 2. The directive you want is `use namespace std;`; note the semi-colon, and the difference is the word `use` versus `using`, as well as the need to actually give the namespace you want to make visible (in this case, …

Member Avatar for David W
0
144
Member Avatar for Christoffer_S

I know you have a working program as of now, but you'll still want to try and understand the difference between a function prototype and a function call, and between the formal parameters and actual arguments. First for prototypes. These are, basically, declarations describing how the function's *signature*, which is …

Member Avatar for Schol-R-LEA
0
646
Member Avatar for Dostoyevsky

We would need to see the code, or at least the parts that are experiencing difficulties. We'd also need to know the errors you are getting. Finally, it would help if you could tell us what the porgram is for, and how it is meant to work. Are you certain …

Member Avatar for Dostoyevsky
0
256
Member Avatar for Ezekiel_1

Actually, it does say Java, in the second assignment description. I suspect, however, that it was an error - my guess is, they use the same basic assigment in both the C++ and Java courses, and the instructor made a mistake when editing the assignment.

Member Avatar for David W
0
527
Member Avatar for ramrokers

As Moschops says, the Turbo C++ compiler dates from 1989, and was for a older operating system that is no longer supported by Windows' backwards compatibility. If you are using a version of Windows newer than XP (that is, Vista, 7, or 8), then there is no way to run …

Member Avatar for Schol-R-LEA
0
172
Member Avatar for gsgikgsgik

First off, we don't do other people's homework for them. Second, we *don't* do other people's homework for them. And third, ***we don't do other people's homework for them***. Sensing a pattern here yet? No one here will simply hand you a solution on a silver platter. If you show …

Member Avatar for Schol-R-LEA
0
160
Member Avatar for Arizal

You say that the code compiles without problem, but I can see an extraneous open brace at the top of the code which would be a showstopper. This may simply be an artifact of copying the code to the forum, however. I recommend you indent your code effectively, according to …

Member Avatar for Schol-R-LEA
0
175
Member Avatar for ben.juarez.773

What is happening here is that you are actually calling the `input()` operation separately each time you are testing for it, which means that if the value of the first entry is not `'1'` (and note that it is the string `'1'`, not the numeric literal `1`), then the value …

Member Avatar for ben.juarez.773
0
182
Member Avatar for ang19

Then you should have asked the question in a new thread, rather than raising a long dead one back up. As for the answer to your question, the original C++ compiler was written in C, and most C++ compilers today are written in either C or C++. I gather, however, …

Member Avatar for David_34
0
1K
Member Avatar for tawanda_1

Oh, and for the future, please do not use ALL CAPS in your postings like that. It is universally considered quite rude, as it is seen as the equivalent of shouting at the top of your lungs. Proper punctuation, grammar and netiquette are quite important in fora like these, *especially* …

Member Avatar for ann.mughal.5
0
305
Member Avatar for lfc3798

We cannot simply give you code; that would be cheating. However, I can offer you the algorithm which you can use; I'm a bit short on time right now, but I should be able to get back to you in a couple of hours.

Member Avatar for TrustyTony
0
273
Member Avatar for alexandru.caplescu

First off, could you give more detail as to what you need? As I understand it, Kirchhoff's First Law is an equation regarding electrical flow across circuit intersections; Wikipedia gives the informal form of it as: > At any node (junction) in an electrical circuit, the sum of currents flowing …

Member Avatar for Suzie999
0
1K
Member Avatar for yoyo.albeatiy

Please do not hijack existing threads with unrelated questions like this; in the future, start your own thread. In any case, the question is too broad, and has too many unknowns (regarding your state of knowledge, the context in which the question comes up, etc.) to be easily answered; it …

Member Avatar for saharsweeto
0
175
Member Avatar for victorkvarghese

Could you post your exact code here, please? I have a suspicion why it isn't working, but it is hard to say without seeing what is actually running.

Member Avatar for slate
0
3K
Member Avatar for folabidowu
Member Avatar for cherrymae.calma
0
276

The End.