No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
I wrote a function that will search a string with a substring. When the substring is found, it is replaced with another substring. The problem I have with my code is that it wont replace the substring unless it is in the beginning of the string. Here's the code and … |
|
I'm trying to find duplicates in an array and removing them by shifting the array index using the same array. I can't figure out where in my code the problem is but I'm still getting a duplicate. Could someone please help pinpoint the problem? I've tried debugging it but I'm … |
|
My PHP account is hosted by the university. I want to send email to my gmail account and not the account tied to my PHP account. Is this possible? |
|
I need some dire help. Whenever I execute my program I get this message "./main: free(): invalid next size (fast)". Which leads me to believe something with my dynamic allocation of an array. I've used a debugger and pinpointed the error to the method where I'm trying to increase the … |
|
I have a dictionary that I would like to load from a file into a class variable. The dictionary holds configuration data. I would have different files for different configurations. I was wondering if there is a way to do this? I found pickle but that saves an existing instance … |
|
I need to be able to print at an offset where the second element of the second list matches up with the first element of the first list. For example have a's line up with the b's: [CODE] list = [[a, b, c, d],[a, X, X, b, c, d],[a, X, … |
|
I'm trying to print horizontally not having any luck. I need to print I#x where x one through the length of a list i.e.-I#1 I#2 I#3 I#4 etc. This is what I have which is syntactically wrong: [CODE]for x in range(1, len(depend)): print "%05s" ('I#'+str(x))[/CODE] Could someone please point me … |
|
I need to parse an assembly program. I have no problems parsing a group of instructions or a group of instructions with one loop. For example: [CODE] LD R2, 0(R1) DADD R4, R2, R3 SD 0(R1), R4 DADDI R1, R1, #-8 DADD R2, R2, R4 or Loop: LD R2, 0(R1) … |
|
This is a very basic question, but I'm very new to python. I want to read data in a file. The data is between two delimiters. I'm not exactly sure how I can extract the data and skip the delimiters. Any help would be great. |
|
I am having a little bit of a dilemma. I have an input file that can have a number 1 through 9 or a asterisk. I am treating 1-9 as a character. I don't know if there is white space or new lines. I can't use >> because I don't … |
|
I need major help. My program will compile but when I run it I get a segmentation fault. I don't know how to run a debugger with multiple files. Could someone please find when this error occurs? My project is due in 2 hours. |
|
Say I have a class named Contestant, could I declare an instance of the Contestant class as: [CODE] Contestant *c = new Contestant; [/CODE] |
|
The program I am working on deals with nested linked lists. I have a Olympics class that uses a linked list for events. Events have their own class with a linked list of contestants of a contestant class for each event. I don't understand why I'm getting these compile errors: … |
|
I have a class named Contestant which holds all the info on a person playing a game. Then I have a game class for all the different games a contestant could be playing. My linked list in the game class is defined by the contestant class. I need to swap … |
|
I have a recursive method that traverses a linked list for a first name or last name then deletes the node from the list. This is what I have: [CODE=cplusplus] void game::DeleteR(string first_name, string last_name, ListNode* &node) //throw (ContestantException) { /* See if we are at end of list. */ … |
|
First I just wanted to say thanks for all the help everyone has provided for me before. I'm sure you wanted to reach through the internet and strangle me :) . I having some difficulty with understanding/implementing a linked list class with another class. Just something as simple as interacting … |
|
I've been banging my head on this errors and can't seem to find where I went wrong. For any of the "set_" errors, set_ (as well as print) refers to a member function of another class . Please, any help would be great. [CODE] test.cpp: In member function `void CDCollection::get(int, … |
|
I have a class named SString, which is a user defined c style string class. The constructor for SString dynamically allocates a char array. Then I have a CD class which contains data about a specific CD, like artist, title, year, etc. They are defined as SString instances. I want … |
|
I'm trying to call a member function inside a class but am having no luck. I need to find the length of the array. When I posted this code before there were some questions on the member functions. The reason those functions are private is that I don't want the … |
|
I really don't know where to start and to be honest I really don't know what I'm doing. I was given this project and we never went over these topics in class or the previous class. My attempts to wing it are not going so well and quite frankly its … |
|
I am writing a program to handle a DVD collection. There are 2 classes. The first class is a string class that has member functions that handle strings(length, compare, etc.) and store strings(dynamic array). The second class handles the actual DVD's-title, year, actors, and brief description. I'm confused on working … |
|
I was wondering if this code is correct syntax for function parameters in a class? [CODE] class myclass { private: char mystring[50]; int length(char string[]); public: int yourlen(){ return length(_string, _string); [/CODE] I know later in my code, I would have something like this: [CODE] mystring A; char string[50], string2[50]; … |
|
Re:
Hello All. I am currently working on a project that introduces us to recursion and was needing some help with my program. This is early code so i know many things aren't correct. [code] #include <iostream> #include <fstream> using namespace std; int str_length(const char[] str); int str_compare(const char[] str1, const … |
|
I need to design a function to find within a string a match to what is being searched and then replace that string with another. For example I need to search the string "baseball" with the string "base" and replace it with "basket". The code I have so far does … |
|
I wrote a function that compares the characters of two strings recursively. If the characters of the strings are all equal the function returns 0. If the character from string1 is smaller ie-"a" to "l" it returns the negative difference of their ASCII vaules. If the character from string2 is … |
|
I have an input file that has call to function and arguments that are passed to that function. There might be one argument or two. A simple while loop for input will not work ex-while(inputf >> function >> arg1 >> arg2) because if a function has only one argument then … |
|
The recursive function is only reversing the first and last characters of a string. I've been trying for hours but cant find the error. Any help would be awesome. The code: [CODE] #include <iostream> #include <string> using namespace std; void str_reverse(char str[], int length) { char temp, temp1; int starti=0; … |