581 Posted Topics

Member Avatar for ShadowOfBlood
Member Avatar for ApMignonne

And Secondly. Why dont you just search for the word Matrix in Your File? [code] string inName[3],inChar[3]; while(in.eof()) string s; in>>s; if(s=="matrix") { for (int i= 0; i<3; i++) { in >> inName[i] >> inChar[i]; } break; } else //Do nothing } [/code] That way You will read the next …

Member Avatar for ApMignonne
0
106
Member Avatar for STUDENT#101

Please Post Your Code That you have worked on and then we can tell you whats wrong. You say that you have tried, So you will need to show the effort that you have put in,

Member Avatar for Freaky_Chris
0
116
Member Avatar for core2d

Or, you can use 2 pointers pointing to the first and last element of the list and then increment 1 and decrement the other. Until we get to the centre of the list . then delete that particular node(s) This way we dont count or, know how many elments we …

Member Avatar for Sky Diploma
0
132
Member Avatar for jeevsmyd

First of all, A lot of people on the internet have a problem when they read in red coloured text. So i prefer you use [CODE] Tags... Secondly, are declaring 3 variables (of your class) and then running a separate function on each of them. As far as time comes …

Member Avatar for Sci@phy
0
657
Member Avatar for shiniboy

Though it is not preffered. You can declare mean as a global variable. So that you can get your program to work Just by snipping out the declarations and the return statement.

Member Avatar for Sky Diploma
0
138
Member Avatar for nrew

Well You take in the data from the user and then again change it back....... With the strcopy(arg1,arg2) Function in main .

Member Avatar for bhoot_jb
0
138
Member Avatar for Stringman

I would also prefer that you use c++ based console in and out mechanisms. [code] printf () [/code] You should consider using [code] cout<< [/code]

Member Avatar for bhoot_jb
0
137
Member Avatar for FtKShadow
Member Avatar for Jennifer84

Well You can use the sort function to list and get the max value . For that you will need to write a bool comp() function for your datatype. Comparison function that, taking two values of the same type than those contained in the list object, returns true if the …

Member Avatar for Jennifer84
0
205
Member Avatar for marivic
Member Avatar for monkey_king

Well , [code=cplusplus] myClass var3=var2+4; [/code] This will work fine only if you provide a constructor taking an int argument or if you write down the operator+ to take in an int. [CODE] myClass var3=4+var2;[/CODE] This will work i guess only if you provide a constructor. But if you are …

Member Avatar for monkey_king
0
149
Member Avatar for masterjiraya

Why Dont you embed the mirror function into the inorder fuction. Or else you can try to create three functions , 1)Inorder 2)Mirror 3)Inorderandmirror(); Basically i dont understand why you cannot call the mirror function through inorder. I think that it would be useful if you provide the code on …

Member Avatar for masterjiraya
0
151
Member Avatar for Seba Sama
Member Avatar for jhonnyboy

I think it is better for you to use a vector You Use A Vector to store in all the strings in your string. This pretty much acts like an array. So you will not be having much problems with it i guess [CODE] vector<string>numbers; string temp; while(!infile.eof()){ infile>>temp; numbers.push_back(temp); …

Member Avatar for Sci@phy
0
141
Member Avatar for jrrr

I dont get it . When the person asks for a clue, You tell him to give the password first. And when he trys to type in a password you ask whether you need any clue. That gets the user nowhere. I recommend that you devise a small flowchart on …

Member Avatar for stilllearning
0
88
Member Avatar for monkey_king

Well You should first implement a template with member function declarations and then you can [code] T& Array<T>:: applyThisWorks(Matrix<T> &m){ Array<T> retA(m.x()); for (int i=0;i<m.x();i++){ Array<T> r = getrow(m,i); retA(i) = sum(r); } return retA; } [/code] I am not a expert on this as i am still learning templates …

Member Avatar for monkey_king
0
8K
Member Avatar for coveredinflies

I dont find any reason on why return *this is present there. If it had to be there it should have been like this. [code] class ThreeD { int x,y,z; public: ThreeD() {x=y=z=0;} ThreeD(int i, int j, int k) {x=i; this ->y =j; z=k;} ThreeD operator+(ThreeD op2); ThreeD& operator=(ThreeD op2);//It …

Member Avatar for vijayan121
0
192
Member Avatar for daesdaemar

Or Else Generate 3 Random numbers and then compare if they are equal or not . You can define 3 variables to hold the numbers and then use if (Statement) to get a true or false. based upon which you can give out a result.

Member Avatar for Sky Diploma
0
2K
Member Avatar for kazek

Well if you include that function in a header inside namespace std It will work. Something like [code] namespace std { remove() { //Func goes here } } [/code] And save that file, Dont forget to include the file when you try to use that function. if remove.h is the …

Member Avatar for mitrmkar
0
91
Member Avatar for NinjaLink

What VernonDozier meant was to remove variable "i" from your code and introduce another variable [code] void countPassing(double grades[]) { int a; a=0; for (int i=0; i<numofgrades; i++) { if (grades[numofgrades] > 59) a++; cout<<a<<"out of "<<numofgrades<<" passed the test"<<endl; } [/code] And secondly ,remove all the "cout" statements out …

Member Avatar for Sky Diploma
0
274
Member Avatar for Sci@phy

If You have No restrictions on editing your file, i guess you can write something like a single letter in the starting of the document, something like a single digit, {0,1} Then in your program [code] int main() { //Code to open file..... //Then check if (filein[0]='0')//Here "filein" is the …

Member Avatar for Duoas
0
411
Member Avatar for jacobdet

I went through the problem, And i think there is a problem with the conversion on the last number [code] for(i=0; i < a.length(); i++){ //converts a char to an int value = a[i] - '0'; store[i] = value; [/code] observe the for loop. try changing it to [code] for(i=0; …

Member Avatar for mitrmkar
0
303
Member Avatar for ron_jay

Well i would have loved to help , But i find myself stuck. I get only 22 different 3 letter permutations with my recrusive function and i am still working on to see what went wrong? [code=cplusplus] #include <iostream> #include <string> using namespace std; class permutation { public: string inval; …

Member Avatar for Sky Diploma
0
339
Member Avatar for guerilladong

I guess the textbook asking that question will have your "great" answers. Just read !!

Member Avatar for Ancient Dragon
0
61
Member Avatar for princess_19

First of all, You dint post out any question, And secondly, while you post in the question, Please post in where you are having problems with your code.

Member Avatar for Narue
0
146
Member Avatar for nizbit

[QUOTE=nizbit;689842]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]; …

Member Avatar for Sky Diploma
0
124
Member Avatar for kylcrow

I guess it is quite simple, You can use an array for rock paper and scissors, Then try to generate a random number, After a random number is got, you can use the modulo operator to get the remainder after dividing by 3, So then you get the computers choice, …

Member Avatar for kylcrow
0
322
Member Avatar for guitarcrazy44

Hey something funny just crept up when i was reading the question [quote] * Another Special! How ever many oranges you buy will give you the same number of percentage off your total bill. (If you buy 10 oranges you get 10% off your total bill.) (For now, ask the …

Member Avatar for Sky Diploma
0
149
Member Avatar for nesfrank

This forums doesnt do your homework [URL="http://www.daniweb.com/forums/announcement8-2.html"]Please Read This.[/URL], We give help to people who are having problems working out thier code. Please post in what you have come up with until now and we will be happy to help

Member Avatar for Sky Diploma
0
70
Member Avatar for ohyeah

And another thing [CODE] void main () {} [/code] In many new c++ compilers is not acceptable.because it is deprecated or something . I prefer that you use [code] int main () {} [/code]

Member Avatar for MelechM
0
156
Member Avatar for shamila08

And Shamila , Instead of printf and scanf i prefer you use functions like cin and cout int the namespace std;

Member Avatar for shamila08
0
285
Member Avatar for gregorynoob

Hey, I dont seem to see any other method than this one. Is there anything wrong with the solution ?

Member Avatar for gregorynoob
0
172
Member Avatar for coveredinflies
Member Avatar for Sky Diploma
0
124
Member Avatar for Motlatjo Chris

First Of All , Please Use Code Tags and Secondly . Specify your Problem And a Tip: Stop using the same names to both pointers and arrays of the same type.

Member Avatar for Sky Diploma
0
175
Member Avatar for TheGhost

I am not sure but !! I think you will first need to convert the return type of the size type to int. try using the following instead. [code]cout<<"size of listName = "<<(int)listName.size()<<endl;[/code] This happens because list::size returns a size_type variable where as you will need an int i guess.

Member Avatar for Sky Diploma
0
130
Member Avatar for timb89

Do you need to take in the input from the user ? And store those values into a file ? Or Do you need to read from a file and then again put the same back into the file ? Please Specify.

Member Avatar for Sky Diploma
0
102
Member Avatar for edouard89

Well No Wonder You are getting errors. This is because you have declared a void function and giving a return value to it.

Member Avatar for edouard89
0
296
Member Avatar for haven_u

You should have used google to search it over. But however here is a small explanation get basically takes in one character from a particular input stream that you have used it with. For Example [CODE] char a = cin.get(); [/code] The above statement takes in a character that a …

Member Avatar for Sky Diploma
0
75
Member Avatar for abhigame

Well , Abhi According to the Question That You are asking. You need the computer to determine the a sequence from user input. This is not definable as the user may type in anything . If thats not the case and you are given an arithmetic progression when 2 numbers …

Member Avatar for papuccino1
0
124
Member Avatar for sasikala123

Lol, Well This is a forum which helps people who show help. But you just cant give in your homework and expect anyone to help you out. When you donot show any effort.

Member Avatar for Sky Diploma
0
136
Member Avatar for chickenlord500

In the function inword() , i dont understand why you are creating new vector words and a character variable guess. Instead of doing that. Pass them as arguments for the function or declare them globally and dont declare them again in the function itself.

Member Avatar for Sky Diploma
0
159
Member Avatar for lazytypist

Well you can use a character Array Of 27. And then assign an alphabet to each of them. And then you can get input from the user and write a find function for finding letter. After you can find the letter store it in one place. =========== Take the first …

Member Avatar for William Hemsworth
0
156
Member Avatar for ar31an

Yes , If you are using Windows As An OS. YOU CAN TRY [code] system(cls); [/code] To Clear the whole thing up and then a printer function added in.

Member Avatar for William Hemsworth
0
208
Member Avatar for radnik

You can start by defining your struct and posting down the code you have come up with until now. Please Read This too: [url]http://www.daniweb.com/forums/announcement8-2.html[/url]

Member Avatar for Tigran
0
97
Member Avatar for 007tron
Member Avatar for VernonDozier
0
106
Member Avatar for FreeFull

Shouldnt You Be Using "||" For OR. I mean [code] if((argv[i] == "-h" | argv[i] == "--help" ) && help != 1) [/code] Should Be Actually [code] if((argv[i] == "-h" || argv[i] == "--help" ) && help != 1) [/code] Right.

Member Avatar for William Hemsworth
0
122
Member Avatar for joshmo

Well You can manually Implement You own Function. [code] void display (stack& s) { for (int x=0; x <s.top;x++) { std::cout <<s.values[x]<<"\n"; } [/code] This is for external stack displaying. you can write a class function that will do the same without taking any argument.

Member Avatar for Sky Diploma
0
90
Member Avatar for 007tron

Is Your member a type FlightTl and i dont see any Declaration of a Flight type for acessing it. Secondly , I dont know perfectly on this matter but i think that only a static class member can be a member of the same class . CODEBLOCKS GIVES THIS A …

Member Avatar for 007tron
0
119
Member Avatar for theUnspeakable

Hey, I remeber a way which can generate changing random numebers but i donot know that if it works properly coz i pretty much forgot that code a long while ago.. The Only Backdrop is that it needs a user input to stop changing random numbers.. [CODE=CPLUSPLUS] #include <iostream> using …

Member Avatar for Sky Diploma
0
94

The End.