• Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Replied To a Post in Mips String Length

    No problem. Fortunately, each of these by itself is fairly easy; actually, `strcat()` and `strcpy()` are very similar, enough so that the easiest solution for `strcat()` in assembly language is …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Replied To a Post in Mips String Length

    The most likely cause is that you accidentally deleted or commented out the function return (`jr $ra`) at the end of `strlen()`. BTW, the size of the string "I " …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Replied To a Post in recursive cin function

    I'm going to recommend two things: first, that you change the return type to `string` and second, that you declare a `char` `ch`. If you then take the return value, …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Began Watching recursive cin function

    Write the definition of a function named copy that reads all the strings remaining to be read in standard input and displays them, one on a line with no other …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Replied To a Post in recursive cin function

    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 …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Began Watching Mips String Length

    I am attempting to write a code with several different segment, such as combine two differents strings, compare two strings, find the length of a string. Right now, I am …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Replied To a Post in Mips String Length

    For the first line of `strlen()`, change the code to addi $t0, $zero, 1 #initialize count to start with 1 for first character The problem you are experiencing is likely …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Replied To a Post in Notation Confusion

    Wait, I apologize, I would expect it to make an infinite loop, as it would never even get to A[]. A stack overflow is still surprising to me, though. **EDIT**: …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Replied To a Post in Notation Confusion

    in the inner loop, you are incrementing `i` instead of `j`. This leads to you walking off of the end of the array `A`, but I would expect it to …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Replied To a Post in Notation Confusion

    I would recommend using the `new` operator rather than the C-style memory allocation, but that is what it sounds like you're expected to use, yes. From the sounds of it, …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Began Watching Notation Confusion

    I was given a project to do, but I don't understand this notation and am rather confused, so I don't even know where to get started. I am supposed to …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Replied To a Post in Notation Confusion

    Has the instructor covered dynamic memory allocation (`new` and `delete`) yet?
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Replied To a Post in Generic streams

    **mike_2000_17**: While that is indeed a solution to the problem as given, I'm not sure it is the answer Labdabeta needs. This has the smell of a [shoe or bottle …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Replied To a Post in How do i go back to a certain line of code?

    Well, we could take the existing function and simplify it like this, if you like: def print_something(ctr): if ctr == '1': print("This is a valid entry.") else: print("Sorry, but what …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Began Watching Detecting Button Presses

    Hi, I have a raspberry pi and was wondering if it was possible to detect button presses from a webpage in python. I have a robot arm and can control …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Replied To a Post in Detecting Button Presses

    A web framework is a set of interconnected libraries and interfaces that allow you to work with web pages in a more structured manner than the default Python library does …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Began Watching Generic streams

    Hello, Looking at the standard streams provided by the stl libraries, it seems as though it is impossible to have 1 stream to use for both standard console IO and …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Replied To a Post in Generic streams

    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 …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Replied To a Post in qustion

    First off, don't hijack other people's threads with unrelated questions; if you have a new question not related to the thread, create a new thread. Second, didn't you read what …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Replied To a Post in Base Conversion

    total=0 This is initializing `total` to zero; by doing it in the declaration list, it means it is done at compile time, speeding up the program slightly. The reason we …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Began Watching qustion

    write a c++ program that print (x,z,T,N) on the form of (*) by usin for loop
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Replied To a Post in qustion

    OK, and where is the question? More importantly, where is the code you've already tried writing? To quote Daniweb rules: > Do provide evidence of having done some work yourself …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Began Watching Array subscript is not an integer?

    i have to add two matrices and i am having this error: "error array subscript is not an integer" line 24 here are my codes: #include <stdio.h> void inputarray(int arg[][3], …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Replied To a Post in Array subscript is not an integer?

    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] …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Began Watching Seeking for minimalistic language for programming problems website

    Hi, colleagues! Last autumn I've started a small web-site with collection of programming problems for beginners. To solve the tasks here users are to submit answers calculated after processing some …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Replied To a Post in Seeking for minimalistic language for programming problems website

    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 …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Began Watching A DOUBTFUL QUESTION..

    can some one help me with this question.. "The name of students are sorted in an array of strings.Write a program to prepare alphabetically sorted listing of names.."
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Replied To a Post in A DOUBTFUL QUESTION..

    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 …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Replied To a Post in Base Conversion

    I'm not sure just how to answer that question. What aspects of it are you unclear on?
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Replied To a Post in Base Conversion

    As far as the size issue is concerned, yes. There really isn't any solution to it in Turbo C that wouldn't take at least twice as much coding as you …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Replied To a Post in Base Conversion

    Oops, I found an error in my last post; the octal code should have been total=(total*8)+value; not total=(total*8)+8; Sorry about that. Also, the `printf()` should have been after the end …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Replied To a Post in Base Conversion

    I see what the problem is now; the lines total=(total<<8)|8; and total=(total<<16)+8; need to be total=(total*8)+value; and total=(total*16)+value; respectively. The reason the binary version worked with this approach is because …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Replied To a Post in Base Conversion

    Why is the indentation relevant? Because it would have made the problem with the ocatal function clear immediately - you have the `printf()` statement inside the loop, instead of after …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Replied To a Post in Base Conversion

    I know it doesn't sound relevant here but you still aren't indenting your code in a useful manner. The last function should look like: void Hexa2Decimal() { char hex16[17]; unsigned …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Began Watching Octal2Decimal & Hexa2Decimal Correction

    Hi everyone my Binary2Decimal is okay now because it can now hold 16 digits. But how come my Octal2Decimal and Hexa2Decimal can't hold 16 digits to convert to decimal it …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Replied To a Post in Octal2Decimal & Hexa2Decimal Correction

    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 …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Replied To a Post in Base Conversion

    Fortunately, the code for the octal function is very similar to that for the binary: void Octal2Decimal() { char buffer[7]; int len, i, total = 0, value; printf("[OCTAL TO DECIMAL …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Replied To a Post in Base Conversion

    All you need to do is delete or comment out that one line. This should do fine: void Hexa2Decimal() { char hex16[9]; unsigned long dec16,i16,sum16,len16; sum16 = 0; dec16 = …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Replied To a Post in Base Conversion

    Oops. Sorry about that debug-print line I left in there. OK, I've checked into this and found that I was wrong about the word sizes in Turbo C++. I knew …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Replied To a Post in Base Conversion

    I went to the extraordinary step of setting up Tubo C++ 1.01 in DosBox on my system, and was able to get the following program to run correctly. Thry it …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Gave Reputation to Ancient Dragon in c++

    Study and work full time with c++ for about 10 years and you will become a master at it.
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Began Watching c++

    i want to be a master on c++
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Replied To a Post in 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 …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Began Watching Base Conversion

    Ok the admin said to me not to post in C++ if my problem is in C language. Ok here's my problem with my program now. #1 If I put …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Replied To a Post in Base Conversion

    I posted [one last message](http://www.daniweb.com/software-development/cpp/threads/474555/corrections-turbo-c-conversion/2#post2072872) in the previous thread, if you haven't read it yet please do so before doing anything else. As for the language issue, I suspected that …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Began Watching differences in classes

    what is different between base class and child class?
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Replied To a Post in differences in classes

    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 …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Began Watching How microprocessor converts binary into decimal equivalent?

    I want to know how a microprocessor converts the binary digits into decimal equivalent. The processor only has the ability of manipulating 0's and 1's but, how these numbers are …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Replied To a Post in How microprocessor converts binary into decimal equivalent?

    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 …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Replied To a Post in Corrections Turbo C++ Conversion

    > Whats wrong with my octal and hex I thought it was right because when I run the program the conversion is correct To illustrate what is going on with …

The End.