• Member Avatar for David W
    David W

    Began Watching homework

    Hi, I need help from anyone to solve this "c programming" or help to teach the method for this question. thank u so much? A bookstore has many customers and …
  • Member Avatar for David W
    David W

    Replied To a Post in homework

    A simple method to get you started is always to carefully read the question over and compare that to 'the example output' ... (Your question and example output are really …
  • Member Avatar for David W
    David W

    Began Watching Win7: Strange fopen() "a+" behaviour

    I am currently writing a little applet to modify files in a certain way. However, I am noticing wildly strange behaviour. I have an output file that is fopen'd in …
  • Member Avatar for David W
    David W

    Replied To a Post in Win7: Strange fopen() "a+" behaviour

    Can you show your code?
  • Member Avatar for David W
    David W

    Began Watching Altcoin won't recognize configuration file

    Hi DaniWeb, I've been programming a litecoin clone for about two weeks now. I came to build the daemon to acquire a merkle hash, but It give me this error. …
  • Member Avatar for David W
    David W

    Replied To a Post in Altcoin won't recognize configuration file

    Can you show your code where you think the problem arises? And also explain, what you think that code is supposed to do. It may simply be that you have …
  • Member Avatar for David W
    David W

    Began Watching C++ - Create Class Object dynamically through cin

    Hi guys, I have a class called Account with variables called Balance and Status. The Member Name is given by the User through cin and represents an the Account Number. …
  • Member Avatar for David W
    David W

    Replied To a Post in C++ - Create Class Object dynamically through cin

    Probably was searching the web and found this page ? So @nonc... Welcome to Dani's place and her C++ help forum. You may not know how to start a new …
  • Member Avatar for David W
    David W

    Replied To a Post in debugging deleting pointer memory using malloc_error_break

    And here is an 'homegrown' Stack example, revised from your example, that you can use to compare and fix up your stack class (it uses the above class SLList) : …
  • Member Avatar for David W
    David W

    Replied To a Post in debugging deleting pointer memory using malloc_error_break

    For example, using the STL stack (with the STL list), this demos a 'proof of concept' ... and a way to trim your code some more ... since you are …
  • Member Avatar for David W
    David W

    Replied To a Post in debugging deleting pointer memory using malloc_error_break

    Perhaps you do not 'see' my method here ... It was to GIVE you some working code examples (just at first for a SLList class) ... so that you could …
  • Member Avatar for David W
    David W

    Replied To a Post in debugging deleting pointer memory using malloc_error_break

    Glad to see that you fixed-up the insert at front and back methods ... that's really great. Now ... here's how I might start out to code a SLList in …
  • Member Avatar for David W
    David W

    Replied To a Post in debugging deleting pointer memory using malloc_error_break

    Not fixed yet ... (Note: there are other problems besides these 2 ...) What is wrong here? (See changes/added comments to your code.) //insert node at front of List void …
  • Member Avatar for David W
    David W

    Began Watching Jar not executing on Mac

    I'm sure this question has been asked before, but I'm at a loss here. I've been attempting to get a piece of C++ code to work. It works perfectly on …
  • Member Avatar for David W
    David W

    Replied To a Post in Jar not executing on Mac

    > Here is the error message I get: "Error: Unable to access jarfile myJar.jar" So ... try moving the file "myJar.jar" to where it is in the path expected.
  • Member Avatar for David W
    David W

    Replied To a Post in Dynamic Mem Allocation within function

    @ mike_2000_17 ... and your advanced approach would also allow speeds ups in reading data from very large files by ... > and call it with: std::vector< int > v; …
  • Member Avatar for David W
    David W

    Began Watching Parsing large text file in Python

    Hi all, I have a large txt file (3 Million lines). Like to use python , to parse the file , so it can be managed by excel. I am …
  • Member Avatar for David W
    David W

    Replied To a Post in Parsing large text file in Python

    If your large data file has data that appears as consistently as your example would suggest, then you might use this simple approach: # processlargeFile.py # FNAME = 'largeFile.txt' try: …
  • Member Avatar for David W
    David W

    Began Watching non portable pointer assignment in function main?

    i somehow can't find how to fix the error: "non portable pointer assignment in function main" #define b break #define p printf #define s scanf main() { char M,[9]; int …
  • Member Avatar for David W
    David W

    Replied To a Post in non portable pointer assignment in function main?

    Also, it is 'int main()' and do not use 'getch()' if you want your code to be portable. Please remember that you are asking experienced C programmers for their valuable …
  • Member Avatar for David W
    David W

    Began Watching debugging deleting pointer memory using malloc_error_break

    Hello programmers! I am working on a program that checks if a user's input is a palindrome (in this case, the input is a string). I am using a custom …
  • Member Avatar for David W
    David W

    Replied To a Post in debugging deleting pointer memory using malloc_error_break

    Just a quick scan and I noticed this: (What is wrong here? Hint what is the tail node value after adding first node to list? What should it be?) //insert …
  • Member Avatar for David W
    David W

    Began Watching Dynamic Mem Allocation within function

    When I dynamically allocate mem within a function, do I have to still manually release it? Or does it go away once the function has run and returned (like local …
  • Member Avatar for David W
    David W

    Replied To a Post in Dynamic Mem Allocation within function

    Best thing here ... really ... is to use the STL vector container :) For example ... vector< int > fillVecFromFile( const string& FNAME ) { vector< int > v; …
  • Member Avatar for David W
    David W

    Replied To a Post in Program skips second loop of inputting with cin.

    This is not the method that you really want to use ... is it? template<typename T> void glueAtEnd( List<T>& a, List<T>& b ) { T value; while( !b.isEmpty() ) { …
  • Member Avatar for David W
    David W

    Began Watching balanced paranthesis

    in data structure, how the paranthesis balanced are checked with stack.little confusion in it.
  • Member Avatar for David W
    David W

    Replied To a Post in balanced paranthesis

    This may be a little simpler C code ... to get you started? -> NO dynamic memory used (stack size pre-fixed at compile time) -> also uses a 'table look-up' …
  • Member Avatar for David W
    David W

    Began Watching Search in File Handling in c++

    Hello Friends ! I am working on a project of CD CAFE. In which I have arranged movies like this : Movie Name::::Genre::::Hero of Movie::::Heroine of Movie and I have …
  • Member Avatar for David W
    David W

    Replied To a Post in Search in File Handling in c++

    You may like to file your data using commas to delimit the data record fields. That way you can easily handle missing fields: MovieName1,Genre1,HeroOfMovie1,HeroineOfMovie1 MovieName2,Genre2,,HeroineOfMovie2 MovieName3,Genre3,HeroOfMovie3, And display as: MovieName1::::Genre1::::HeroOfMovie1::::HeroineOfMovie1 …
  • Member Avatar for David W
    David W

    Replied To a Post in Program skips second loop of inputting with cin.

    Ok ... you have multiple potential problems. It is often best to solve them one at a time. A 1st problem is your driver test program. So here, I just …
  • Member Avatar for David W
    David W

    Began Watching Program skips second loop of inputting with cin.

    Hellp programmers! I am working on a program that uses two objects of a custom class template List [which is a linked list, with each item pointing to the next] …
  • Member Avatar for David W
    David W

    Replied To a Post in Deleting duplicate strings from an array of strings

    As well advised by Dani's @Moschops above ... you can streamline your code and logic flow by using the STL 'set' container ... If you want to preserve the original …
  • Member Avatar for David W
    David W

    Replied To a Post in too many chars in my switch print menu too many times

    This demo of a menu -> choice pattern is simple and easily adapted to many student type menu -> choice type problems. Note how it *simply avoids* the very common …
  • Member Avatar for David W
    David W

    Began Watching too many chars in my switch print menu too many times

    When a user enters multiple keystrokes the meny prints multiple times. It should spit out an error and reprint the menu once...what gives? void mainMenu(char entries[], int index[]) { char …
  • Member Avatar for David W
    David W

    Replied To a Post in too many chars in my switch print menu too many times

    This demo of a menu -> choice pattern is simple and easily adapted to many student type menu -> choice problems. Note how it *simply avoids* the very common ... …
  • Member Avatar for David W
    David W

    Began Watching files

    from sys import argv from os.path import exists script, from_file, to_file = argv print "Copying from %s to %s" % (from_file, to_file) # we could do these two on one …
  • Member Avatar for David W
    David W

    Replied To a Post in files

    Further to comment by @vegaseat ... you can print out ... print( type( in_file ) ) # debugging Python object types # print( type( indata ) ) You may like …
  • Member Avatar for David W
    David W

    Replied To a Post in OOP with mytime

    Actually ... the notion of 'between' ... could actually be expressed as this: class MyTime: # 24 hour clock # def __init__(self, hrs=0, mins=0, secs=0): self.hours = hrs self.minutes = …
  • Member Avatar for David W
    David W

    Replied To a Post in syntax analyzer

    @shyamdadhich Please start a new thread for your question. Best to ask C programming questions in the C forum.
  • Member Avatar for David W
    David W

    Replied To a Post in OOP with mytime

    Yes ... it is. These are the program output results I get: (# Note: comment added #) t1 = 09:59:59 t2 = 10:00:01 t = 10:00:00 between( t2, t, t1 …
  • Member Avatar for David W
    David W

    Replied To a Post in Deleting duplicate strings from an array of strings

    You will need to provide more information about your program ... for example ... provide a complete working program that illustrates your question/problem? Note: storedstrings[i][k] and storedstrings[i] are NOT the …
  • Member Avatar for David W
    David W

    Replied To a Post in inventory system (get free slot)

    Well ... there are many ways to go about your problem. If you have no particular design constraints or requirements (beyond those listed below) ... this next little demo may …
  • Member Avatar for David W
    David W

    Replied To a Post in inventory system (get free slot)

    Another way ... struct Bag { string name; vector< string > slots; Bag() {} Bag( const string& name, size_t n ) : name(name) { slots.reserve(n); // or maybe resize(n) ? …
  • Member Avatar for David W
    David W

    Began Watching Deleting every occurrences of Pattern in String.

    I want to Delete every occurrences of Pattern in String. But What's the problem? Please help with the following C Code. #include<stdio.h> #include<string.h> #include<stdlib.h> char* SUBSTRING(char *STRING,int POSITION,int LENGTH); main() …
  • Member Avatar for David W
    David W

    Replied To a Post in Deleting every occurrences of Pattern in String.

    What is wrong with this code? char* processIt( /* */ ) { char local_buf[90]; /* get some stuff into local_buf */ return loacal_buf; /* Hint! Is this line ok? */ …
  • Member Avatar for David W
    David W

    Began Watching OOP with mytime

    I'm trying to write a boolean function that takes two Mytime objects, t1 and t2 as arguments, and returns True if the object falls inbetween the two times. This is …
  • Member Avatar for David W
    David W

    Replied To a Post in OOP with mytime

    You might try something like this ... # compareTimes.py # class MyTime: # 24 hour clock # def __init__(self, hrs=0, mins=0, secs=0): self.hours = hrs self.minutes = mins self.seconds = …
  • Member Avatar for David W
    David W

    Began Watching Splitting a filename

    Im working on a project where i have to get the number of printers that are allocated to a certain job and need to split the file name up so …
  • Member Avatar for David W
    David W

    Replied To a Post in Splitting a filename

    This may give you some ideas to get you started ... # fileTypes.py # myFiles = [ 'news.txt', 'data.dat', 'programcpp.cpp', 'programc.c' ] myTypes = [ '.txt', '.dat', '.cpp', '.c' ] …
  • Member Avatar for David W
    David W

    Began Watching Deleting duplicate strings from an array of strings

    I'm making a word unscrambler, an anagram solver of sorts. So, I've stored all possible variations of the word in storedstrings which is an array of strings. Now, i need …

The End.