Forum: C++ Jan 10th, 2009 |
| Replies: 8 Views: 521 Thank you for all of your input. I basically started this whole project to try and do a little learning by experience with class relationships, dynamic memory management, and found a new topic to... |
Forum: C++ Jan 7th, 2009 |
| Replies: 8 Views: 521 Ok, I'm sorry this is so long, but you did ask for my code.
BTW, I'm running this with the default gcc compiler that comes with the binary release of the codeblocks IDE.#ifndef _LIST
#define _LIST... |
Forum: C++ Jan 7th, 2009 |
| Replies: 8 Views: 521 Another quick question. I have a begin() function that returns the head of the list, but I cannot reference it when I try to call it from another list that came into the current list as an argument... |
Forum: C++ Jan 7th, 2009 |
| Replies: 8 Views: 521 Thanks a lot for your help, this clears things up quite a bit. I've started working on a basic_link iterator, I am trying to implement some operators, and I am not sure of an effective way to... |
Forum: C++ Jan 7th, 2009 |
| Replies: 9 Views: 378 Use for loops to print the stars, the spaces, etc. The standard for loop structure is one of the following two
for( int i = 0; i < numberOfTimes; i++ )
for( int i = 1; i <= numberOfTimes; i++ )
... |
Forum: C++ Jan 7th, 2009 |
| Replies: 9 Views: 378 The first thing you need to do is get the number of lines to print, using cin. First, create a variable to hold the number of lines, then read it in from the user.
An example would be
int count;... |
Forum: C++ Jan 7th, 2009 |
| Replies: 8 Views: 521 I am trying to overload operator++ for a type I have defined. Here' s a little explanation beforehand.
I am working on a link_list class that can be used to create dynamic arrays of any type. I... |
Forum: C++ Dec 14th, 2008 |
| Replies: 2 Views: 652 I'm sorry to keep throwing on questions, but I found one more question I have, is there a way to create a standard for operator function? For example, if I want something like this for operator... |
Forum: C++ Dec 14th, 2008 |
| Replies: 2 Views: 652 Ok, I found a fix, I replaced the const link& with a regular link on line 40, but I don't understand why it can't be passed like that to avoid the recreation of the variable. If anyone could clear... |
Forum: C++ Dec 14th, 2008 |
| Replies: 2 Views: 652 I'm trying to create an template of an array class that encapsulates an array of a given type with several methods that are useful but nonstandard to regular c++ arrays. I have created a link struct... |
Forum: C++ Oct 23rd, 2008 |
| Replies: 6 Views: 538 Found it...Thanks so much for all your help Narue. I think I have a better grasp on all of this now. |
Forum: C++ Oct 22nd, 2008 |
| Replies: 6 Views: 538 First of all, thank you so much for all of this help, it's really helping me understand all of this.
Second, I did a lot more looking into it and reading, and I think I came up with something... |
Forum: C++ Oct 22nd, 2008 |
| Replies: 6 Views: 538 I've played around with some inputs and such looking at it from that point of view and it makes sense. I still don't fully understand why it remains in an error state, even if the ignore() is... |
Forum: C++ Oct 21st, 2008 |
| Replies: 6 Views: 538 I have a feeling ya'll get plenty of cin questions here and are quit tired of them, but I have a few that are a little more in depth. I started trying to write my own input stream flush template and... |
Forum: C++ Jun 10th, 2008 |
| Replies: 6 Views: 17,008 Thank you all for your help. I found a few further problems that were just slight kinks so I scratched the whole thing and started over but used the same principle. Anyway, I have it all worked out... |
Forum: C++ Jun 9th, 2008 |
| Replies: 6 Views: 17,008 Ok, one more question if you don't mind helping me out. I would like to make it so that if the line is less than 79 characters long, it will check the next line to see if the first word will fit on... |
Forum: C++ Jun 9th, 2008 |
| Replies: 6 Views: 17,008 Thank you both for your help. I followed your advice and did a few extra tweaks, and now my program works to perfection. Thanks again. |
Forum: C++ Jun 8th, 2008 |
| Replies: 6 Views: 17,008 Ok, I was trying to write a program that formats a plain text file to the formatting standards of gamefaqs.com (no trailing spaces and no more than 79 characters per line). To my eyes, my code looks... |
Forum: C++ May 13th, 2008 |
| Replies: 4 Views: 724 I tried using sizeof() and all occurrences returned 4. sizeof(argv), sizeof(argv[0]) and sizeof(argv[1]) all returned four resulting in a size of 1 even though argc was equal to 5.int main(int... |
Forum: C++ May 13th, 2008 |
| Replies: 4 Views: 724 Alright, thank you for your help. What I was trying to do was access the number of elements in the array to iterate the pieces of the char* array into the string* in order to set up the overloaded =... |
Forum: C++ May 13th, 2008 |
| Replies: 4 Views: 724 I have been teaching myself c++ for a little while now and came across something I couldn't figure out. I am trying to figure out how many char*s there are in a char**. In the current program I am... |
Forum: C++ Apr 24th, 2008 |
| Replies: 18 Views: 1,713 Fantastic, thank you very much. I got it all working. I replaced the alias based calls to the c++ code with a function based call and now everything is working exactly how I wanted it to. Thank you... |
Forum: C++ Apr 24th, 2008 |
| Replies: 18 Views: 1,713 Does anyone know if there is a way to catch a c++ scripts main function return value in the bash shell and use it to determine whether or not to run an additional line of bash code? (I can work out... |
Forum: C++ Apr 23rd, 2008 |
| Replies: 18 Views: 1,713 I'm sorry, I didn't write that correctly. I didn't mean bash script; I meant bash command. From what I have read, it is not an actual Linux command. "history -c" is actually a bash command that bash... |
Forum: C++ Apr 23rd, 2008 |
| Replies: 18 Views: 1,713 For anyone reading this who may be looking for an answer ( or possibly just to let Ancient Dragon know ) I found an answer through pure speculation. I looked at the alias I used to run the program... |
Forum: C++ Apr 23rd, 2008 |
| Replies: 18 Views: 1,713 I ran a few other shells to see if a few other variables would be acquired successfully, and oddly, $PWD (the current directory of the open shell) was acquired successfully... even after being run... |
Forum: C++ Apr 22nd, 2008 |
| Replies: 18 Views: 1,713 It did indeed return NULL. I've tried looking other places for answers and still no luck. Thank for your help up until now and for any further help Dragon, I really appreciate it. |
Forum: C++ Apr 22nd, 2008 |
| Replies: 18 Views: 1,713 #include <iostream>
#include <string>
using namespace std;
int main(int argc,char *argv[])
{
string input;
input = getenv("HISTFILE"); |
Forum: C++ Apr 22nd, 2008 |
| Replies: 18 Views: 1,713 I am receiving an error, no match for 'operator==' in 'input == 0' on the line input=getenv("HISTFILE"); |
Forum: C++ Apr 22nd, 2008 |
| Replies: 18 Views: 1,713 I tried to run this
input = getenv("HISTFILE");
cout << input << endl;
It dropped and I received a segmentation fault. |
Forum: C++ Apr 22nd, 2008 |
| Replies: 18 Views: 1,713 I would assume it does. When I run "echo $HISTFILE" (the bash command for displaying variable for those that don't know) in the bash shell, it returns the file that I am intending to reach. For "echo... |
Forum: C++ Apr 22nd, 2008 |
| Replies: 6 Views: 1,615 As for the lowercasing, I have a function I created (with help from someone else) that could help you. First, you should try it for yourself though. If you can't I can give you the code. Try using a... |
Forum: C++ Apr 22nd, 2008 |
| Replies: 18 Views: 1,713 I am currently using Kubuntu 8.04. Although I do not know any bash, I altered the bash shell (via internet guides) to append history instead of truncating the history file. After editing the shell,... |
Forum: C++ Mar 12th, 2008 |
| Replies: 7 Views: 1,787 That is exactly what I did. And I changed lines 161 to 168, I changed y_n to a char* and accepted the input directly into it, using cin.getline(y_n, 10), changed it to lowercase, then used its value... |
Forum: C++ Mar 12th, 2008 |
| Replies: 7 Views: 1,787 The problem with that is passing the variable to my function .saveBook(). That function runs from char pointers. I asked what kind of data .c_str() was in hopes that I might be able to use that. I... |
Forum: C++ Mar 11th, 2008 |
| Replies: 7 Views: 1,787 Thank you for your help. Using your method however, input is lost while gathering input on whether or not to delete an existing file. However, your help with the .c_str() function did inspire me to... |
Forum: C++ Mar 11th, 2008 |
| Replies: 7 Views: 1,787 I have been doing c++ for somewhere between 1 1/2 and 3 months (I'm awful keeping up with time). I have a program (one of my first) that I have taken and added pieces to since I made it and it has... |
Forum: C++ Feb 12th, 2008 |
| Replies: 17 Views: 7,098 As for the previous syntax working
temp.book1[a]->name = book1[a]->name;
That still won't compile for me and still gives me the same errors.
Instead I did this syntax (since all book1... |
Forum: C++ Feb 12th, 2008 |
| Replies: 17 Views: 7,098 temp.book1 is intended to be a variable that copies all the entries firs from book1 then from part.book1 and then return that book to the operator call. I now have the code fixed, thank you very... |
Forum: C++ Feb 12th, 2008 |
| Replies: 17 Views: 7,098 I understood the referencing of pointers and the similarity to arrays and thats what I was trying to accomplish, but that clears things up for me a little bit, thank you Vernon. Actually, you asking... |