Forum: C++ 32 Days Ago |
| Replies: 1 Views: 233 Hi, I am reading from a text file and stored it onto a string variable. Now I want to split the string and I tried looking it up on the web and found the strtok () function but that only works on a... |
Forum: C++ Oct 19th, 2009 |
| Replies: 0 Views: 163 I am trying to do some arithmetic operation on a stack but I am little confused on how would I implement it.
For instance I have a statement:
add(multiply(2,3),4) which is equal to 2x3 = 6 + 4 =... |
Forum: C++ Oct 10th, 2009 |
| Replies: 1 Views: 191 Hi guys,
Please can someone explain me how would I split a string into groups.
In other words, I have a string of numbers, as such:
123456789
I am supposed to store them in linked list nodes as... |
Forum: C++ Oct 5th, 2009 |
| Replies: 3 Views: 249 D.I.C Head
**
Joined: 22 Oct, 2007
Posts: 51
[IN]
My Contributions
I am little confused here. So please help me. |
Forum: C++ Sep 9th, 2009 |
| Replies: 7 Views: 778 I finally realized that I can use a temp variable to replace the word (I dunno what was I thinking until now!) But now I don't know how will I put the replaced word back into the sentence.
I mean,... |
Forum: C++ Sep 7th, 2009 |
| Replies: 7 Views: 778 Ok I am almost done with this program except for the replace part. Here is my code so far:
#include<iostream>
#include<fstream>
#include<string>
#include<iomanip>
using namespace std; |
Forum: C++ Sep 6th, 2009 |
| Replies: 7 Views: 778 Thats an interesting point of view. I guess I wasn't thinking the right way. Thanks for the idea, I may try that way. |
Forum: C++ Sep 6th, 2009 |
| Replies: 7 Views: 778 I am trying to write a program in which a big text file is read and then user searches for a word and replaces it with another word. To implement this I was thinking to store the file read into an... |
Forum: C++ Dec 13th, 2008 |
| Replies: 4 Views: 429 Thanks guys. Davidoria's method worked out. But I am confused. Why would not using reference as I did earlier is not working.
From what I understood from my course, is I am sending the reference... |
Forum: C++ Dec 13th, 2008 |
| Replies: 4 Views: 429 Hi, I am trying to write an address book. The problem is: in my class declaration I declared a mutator.
In the implementation, I am asking the user to enter his address, city, state and zip.
So... |
Forum: C++ Dec 13th, 2008 |
| Replies: 5 Views: 409 Hi, I declared and implemented a print() function in a class. But when I call this function it is giving me an error: which says that function does not take 0 arguments. But what should my arguments... |
Forum: C++ Dec 12th, 2008 |
| Replies: 1 Views: 902 I am writing a program in which a print function takes in users' street address(string), city (string) , state (string), zip(int).
What will my return be for this function?
My code snippet is... |
Forum: C++ Dec 12th, 2008 |
| Replies: 1 Views: 322 Solved it.
I was able to solve the error.
The problem was with the return type of the print_add() function. I changed it from string to void and the error got resolved.
But this leads me to a... |
Forum: C++ Dec 12th, 2008 |
| Replies: 1 Views: 322 Hi I am writing a address book program that is giving a run time error. Please if someone can compile and check this error, and then explain/ show me how can I resolve it. I am pasting my code in... |
Forum: C++ Dec 7th, 2008 |
| Replies: 4 Views: 488 Thanks, I knew I was forgetting some simple command but was not sure about it. |
Forum: C++ Dec 7th, 2008 |
| Replies: 4 Views: 488 Please can someone show me how would I create a file using fstream
that would take the contents from another existing file and user input sentence.
for example:
I have file1 with some contents... |
Forum: C++ Dec 3rd, 2008 |
| Replies: 3 Views: 321 Thanks, I actually figured out most of the stuff.
But I have some problem in my code. In the main(), I am trying to print the sales figure, but instead it is printing the address of the sales array.... |
Forum: C++ Dec 3rd, 2008 |
| Replies: 3 Views: 321 I have an assignment to implement a salesperson class.
Here is the layout I got from prof.
My questions are typed in red between function prototypes.
Any help is appreciated.
Thanks.
... |
Forum: C++ Nov 29th, 2008 |
| Replies: 10 Views: 722 |
Forum: C++ Nov 28th, 2008 |
| Replies: 5 Views: 1,177 Well I was able to resolve the problem
thanks for all the help though. |
Forum: C++ Nov 28th, 2008 |
| Replies: 5 Views: 1,177 Hi everyone,
I have worked some more on my code and this time I am getting some error that I am not able to resolve. Please help me.
The error says: "initialization skipped by case label." Please... |
Forum: C++ Nov 28th, 2008 |
| Replies: 10 Views: 722 Oh, O.k. I understand that. But could you show me how can I show that data on the screen.
Thanks. |
Forum: C++ Nov 28th, 2008 |
| Replies: 10 Views: 722 Well, if the program is opening the file then I am suppose to be able to see all the text in the file. I mean there is some data on that file. The whole purpose here is that through fstream I shoud... |
Forum: C++ Nov 28th, 2008 |
| Replies: 10 Views: 722 I know that but then why is it not opening the file. Is there something wrong in linking the file. I mean there has to be something because of which it is not working as it should. |
Forum: C++ Nov 28th, 2008 |
| Replies: 10 Views: 722 The problem is not with case of h because intially I had both cases of h in my swith statement but commented one out to figure out the problem switch statement.
And yes my file is exactly in the... |
Forum: C++ Nov 28th, 2008 |
| Replies: 10 Views: 722 I am trying to read a file from fstream in a switch statement but something in the code seems to be stopping this part of my code to be read by the compiler. Please some one let me know what am I... |
Forum: C++ Nov 7th, 2008 |
| Replies: 6 Views: 582 And also the paranthesis: (*item)-- does not make any difference coz I tried doing that. |
Forum: C++ Nov 7th, 2008 |
| Replies: 6 Views: 582 "Copypaster"? Excuse me, being a beginner, its not a big deal if I made a mistake. I wrote the program the way I understood. I did not copy paste it from anywhere. So if u know something please... |
Forum: C++ Nov 7th, 2008 |
| Replies: 6 Views: 582 Sorry, but I don't get what exactly should I do to get the compiler to read in the cin stream.
Please can you elaborate on that |
Forum: C++ Nov 7th, 2008 |
| Replies: 6 Views: 582 Hi, I was working on my assignment and on compiling everything works perfect except at one place the compiler seems to skip the cin command.
Here is my code: the skipped command is highlited in... |
Forum: C++ Nov 6th, 2008 |
| Replies: 4 Views: 865 Well, I should use dynamic arrays(that makes more sense to me). I declared my array as constant just to see if the program works and to be able to compile. I need to replace that with dynamic arrays. |
Forum: C++ Nov 6th, 2008 |
| Replies: 4 Views: 865 thanks for the link. That makes sense but I am confused with using dynamic arrays with my program.
What I mean, in the tutorial for dynamic arrays:
1. it creates a pointer to int, int* a = NULL;... |
Forum: C++ Nov 6th, 2008 |
| Replies: 4 Views: 865 Hi guys, being a beginner I have some trouble with pointers. I don't know but something about using pointers is just not getting clear to me.
My assignment requires that from an array of given... |
Forum: C++ Oct 25th, 2008 |
| Replies: 3 Views: 554 That makes sense.
Thanks. |
Forum: C++ Oct 24th, 2008 |
| Replies: 3 Views: 554 Hi guys, this 2D arrays is not making sense to me. Some how I am just too confused. What am trying to do is average the rows in 2D array and average the columns in the 2D array seperately. Here is... |
Forum: C++ Oct 23rd, 2008 |
| Replies: 4 Views: 1,573 Thanks. I made changes to my co[codde as you said but I am getting syntax errors which I am not able to solve lf anyone can take a look that would be really great.
// Hw-4_Bhasin.cpp : Defines... |
Forum: C++ Oct 23rd, 2008 |
| Replies: 4 Views: 1,573 Hi, I was doing my assignment which states:
The user to enter a string which should be stored in Input_String[].
2) Then reverse the string and save it to another array called Output_String[].
... |
Forum: C++ Oct 21st, 2008 |
| Replies: 6 Views: 562 |
Forum: C++ Oct 20th, 2008 |
| Replies: 6 Views: 562 Thanks. It worked fine. But it still gives me an error if I don't declare the function rev_str() as local. The error states that: rev_str: identifier not declared.
In other words it is not... |
Forum: C++ Oct 20th, 2008 |
| Replies: 6 Views: 562 Like I said on making the function prototype local, the program compiles and runs but it does not execute the function body.
To be more specific, when the user inputs r or R, the switch statement is... |