581 Posted Topics

Member Avatar for Awebb999

Syntactically your code is alright , but there is a logical error that you will have to figure out. The basic algorithm would be like this Take a value from the x List. then check if the value is present in [COLOR="Green"]all[/COLOR] the array-spaces in the new_array. If it is …

Member Avatar for Sky Diploma
0
72
Member Avatar for tomtetlaw

I am not sure about this , But does this happen because all of the global elements are constructed only at the start of main ?

Member Avatar for Sky Diploma
0
113
Member Avatar for kyumi419

This is how we can sum up the whole Pattern ... See that the 1st line starts up with the first and last space filled with a '*' And Then in the second line.there is an increment at the left side by one, and on the other side you have …

Member Avatar for kyumi419
0
108
Member Avatar for crash override
Member Avatar for yonghc

It is not that you are creating 5 strings of size 35, But actually Creating an 2-d array of 5 rows and 35 columns. The size of the string is not constant and can extend as much as possible ,until you have the "space" to store such a long string.

Member Avatar for yonghc
0
409
Member Avatar for Supercharger

FIrstly Please Donot Send PM'S asking for people to solve your problem. There are high chances that many will just Ignore your problem and you will not even get suggestions to your problem. [COLOR="Red"]The proof of your PM[/COLOR] [QUOTE=Supercharger][B]Sorry for the random message. But would you care to help me …

Member Avatar for dgr231
0
156
Member Avatar for suutukil

Next time use CODE TAGS!! The First thing is that you might be using a very old compiler to compile your code. this is evident from [icode]#include <iostream.h>[/icode] but asides that , I see that you have not implemented a sorting function in the first place. Consider this : Firstly …

Member Avatar for suutukil
0
623
Member Avatar for Demonisya

>>what id i swap the num-- to --num what will that do?? -- is the decrement operator. The Basic function of the Decrement operator is to decrease the value of the variable by 1.Thats pretty simple right. However Decrement/Increment can be used in two methods they are [b] Prefix [/b] …

Member Avatar for minigweek
0
2K
Member Avatar for Tom Tolleson

Well , if you have started C++ right now , It would be hard to understand what [ICODE] int main () [/icode] stands for, Most books explain the code as the place where the execution of the program begins. And I tend to prefer it to be that way, until …

Member Avatar for Tom Tolleson
0
129
Member Avatar for tomtetlaw

[QUOTE=Hiroshe;934825]It's a stratagy to make your teachers stop asking you questions. :P I kinda wrote it as I was looking it up so it ended up slightly longer than I thought. Also didn't notice the scroll bar shrinking. Oww well :$[/QUOTE] I wonder what your essay would be like!!! ;)

Member Avatar for kaninelupus
0
606
Member Avatar for khanalone1

The main Problem in your code is that it replaces the letter "b" with the letter in UNICODE represented as "001A", which is the key to break the execution of the program.

Member Avatar for khanalone1
0
528
Member Avatar for anthony1990

Anthony , Welcome to Daniweb. Firstly it is necessary that all the OLD THREADS in this forum remain DEAD. Hence it is not considered well to hijack a thread, secondly to hijack the thread whose last post was about 2 years old. Secondly the use of [noparse][CODE] [/code] [/noparse] tags …

Member Avatar for Sky Diploma
-1
159
Member Avatar for D.JOHN

[url]http://www.cplusplus.com/reference/clibrary/cstdio/printf/[/url] This is a complete explaination of the printf function . you will notice that %x or %X is denoted to show the hexadecimal notation. Though I am unsure about being able to print out the binary value.

Member Avatar for D.JOHN
0
209
Member Avatar for JETFUSION
Member Avatar for myle

Well are the operations in your code. represented by a_1 , a_2, Different functions alltogether and is there anyway that we could represent a particular sub-process with a time constraint. If So you could always, Try a Shortest Time Notation which compares 2 stacks and looks to see which operation …

Member Avatar for myle
0
181
Member Avatar for JETFUSION

Btw, You should also note that the Votes are CASE-SENSITIVE too. So you will need to check if CAPS-LOCK is on or else the votes would all go to VoteTo0.

Member Avatar for Sky Diploma
0
80
Member Avatar for lotrsimp12345

Hehe, I guess SALEM's Right As Always ;) Btw, For the OP, Here's a Tip that would help you out. Check out how "Pointers work." If you figure that out, I guess you will find that its absolutely unnecessary to use a member temp and Also recognise that you are …

Member Avatar for lotrsimp12345
0
121
Member Avatar for Miganders

btw, if you are thinking of comparing a char type only and not a char string, ie: if keypressed is of type char. You should use ' instead of " as quotes

Member Avatar for Miganders
0
259
Member Avatar for prodigyaj

Well, Sum to n terms is [tex] \frac{n*(n+1)}{2} [/tex] Where is the need for [tex]a/b[/tex] in your equation. Please Be a little more elaborate so that we can understand what exactly is your aim.

Member Avatar for Sky Diploma
0
115
Member Avatar for ihatestarch

I think you will basically need a square matrix, ie: no. of columns = no. of rows. then, You could do somthing like this Well the recursive function might be applied on only the last row. you could say somthing like val(x,y)=val(x-1,y-1)+val(x-1,y); This would be the function which should end …

Member Avatar for ihatestarch
0
2K
Member Avatar for William Hemsworth

Instead of checking whether the character is a alphabet. wouldn't isalpha do the trick ?

Member Avatar for William Hemsworth
0
743
Member Avatar for thug line

>>zup pipz?? [B][COLOR="Red"]Voilation 1:[/COLOR]NO L33T TALK PLEASE!![/B] >>i want to create a anti virus using batch file.. Oh, Great, I hope you succeed in your attempt but one question... [COLOR="Green"]" How Is This Related to C++ ?"[/COLOR] Batch Files can be created with the help of a normal text editor …

Member Avatar for Sky Diploma
-2
155
Member Avatar for NinjaLink

The function [icode] toupper[/icode] takes a character argument and returns a character. so you cant assign a string and expect to get back the string itself. You will have to replace every letter in the string with its equivallent.Upper case character.

Member Avatar for tiluyomade
-1
151
Member Avatar for cmel89
Member Avatar for techly

Well, You know that the 3 x 3 Matrix could be solved by first element (2x2 Matrix,) -(2nd Element )* (2x2 ) Matix ................ The same applies to the NxN matrix on a large scale, All you have to do is to. (first element ) * (Det of (N-1) * …

Member Avatar for Sky Diploma
0
214
Member Avatar for jempag

jempag, It is kinda hard for anyone, to predict your exact approach into writing a program to either encrypt or decrypt. Even if they are familiar with the cipher. Therefore, in order for you to get better suggestions I guess it would be compulsory for you to first take the …

Member Avatar for Sky Diploma
0
472
Member Avatar for southernd0529

Are you sure if your code compiles, Its your 13th post and The Lack of Code Tags make this program a lot more messier. [code] for (i=0; i > 30;++) { array[i]=AccumalatedValue cout<<array[i]<<endl; {[COLOR="Red"] //Shouldnt this be '}'[/COLOR] [/code] And where is the ending Brace for the function itself. Apart …

Member Avatar for Nathan Campos
-2
120
Member Avatar for usagi713

From the next post please use code tags. Well, By the code it seems like you have understood the usage of `Struct's` and How to handle `structs`. But you seem to have become confused upon something known as "**Scope or Resolution**". Consider the following Example. #include <iostream> using namespace std; …

Member Avatar for dgr231
0
271
Member Avatar for gretty

Well i compiled the program and it seems to work just fine. Are you sure, that the program crashes if INput is >4?

Member Avatar for mrnutty
0
232
Member Avatar for SeriousTyro

Firstly It might be a mis-judgement that you choose C++ just because of the number of thread, Well The Language should actually be determined by looking at what you are going to program. And secondly, the experience you have in a particular programming language also counts. Apart from that, i …

Member Avatar for Salem
0
149
Member Avatar for gretty

[code] else { array[i] = n-1; } [/code] Assigning n-1 is a problem, because n-1 might have already been present in the array. Instead , try to generate another random number for position 'i'. But the for loop increments the value of 'i' in the next iteration . Though I …

Member Avatar for Sky Diploma
0
127
Member Avatar for Democles

Look at Line 52. [code=cpp] cout << center (title)<<endl; [/code] You are trying to send a void type to an outputstream. CODE LINE 26 is the proof of that. [code] void center(string const &str) [/code] Where as actually you donot need the [icode]cout[/icode] statements as the function implicitly uses cout …

Member Avatar for Sky Diploma
0
122
Member Avatar for jeezcak3++

[code=cpp] m = momo.operation(3, 4, momo.addition); [/code] Try to send a reference of that function . [code=cpp] m = momo.operation(3, 4, &momo.addition);[/code]

Member Avatar for mrnutty
0
93
Member Avatar for low1988

Well, I have a little trouble understanding your question. I just tested out your program.... By this i figure 2 things, 1. You want the computer to move exactly the number of squares specified by the user without any intervention. 2. You want the computer to stop moving if you …

Member Avatar for mrnutty
0
146
Member Avatar for the great

Well, Its quite simple, Use the same formula that you have in the existing code, But just change all the instances of '5' with a variable. For Eg: [code] for(i=1; i<=5; i++)[/code] This could be something like/ [code] int len=5; for (i=1;i<=len;i++)[/code] Now you will then need to further need …

Member Avatar for Sky Diploma
0
179
Member Avatar for gretty

I think that we might basically sort your array according to the length of the word. Then The Binary Search Would get you to one of the bounds of the SearchList containing the same length, Then I guess You can take in the corresponding letters and compare to their equivallents, …

Member Avatar for VernonDozier
0
441
Member Avatar for poliet

I think it would work if you could change this [code] a->pVar=static_cast<int*>(passedVar); [/code] to [code] static_cast<int*>(a->pVar)=static_cast<int*>(passedVar);[/code] The error you get is because you are trying to make a void pointer refer to a int pointer (Because the cast makes the void pointer to passedVar behave like an int*) So please …

Member Avatar for poliet
0
220
Member Avatar for tomtetlaw

Well there is the use of a typedef. [code] typedef void (*func_int) (int); //This would make the pointer to function accessible by the name func_int void func (func_int func name); //YOu can use that as a parameter { func_int varname = &name;// And Create new objects :) } [/code]

Member Avatar for mrnutty
0
110
Member Avatar for the great

[QUOTE=adatapost;951518]the great, study this thread - [URL="http://www.daniweb.com/forums/thread78955.html"]void main vs int main [/URL] >I am unable to change the program. Can any one help? I am really in need of it.... Use two dim. character array and put asterisks '*' and spaces.[/QUOTE] Yes, this is prettymuch the best way to do …

Member Avatar for Sky Diploma
0
143
Member Avatar for Belthemet

[quote] its impossible to just pass a, b and not c ?*/[/quote] Not necessaryly. Well another alternative would be to give default values to your arguments for eg: [code] void funcname(int a, int b=0, int c=0); [/code] Now i can just call the function in these 3 manners for eg: …

Member Avatar for Belthemet
0
153
Member Avatar for esesili

SO you have 2 patients with the same doctor. Though it is not impossible , it is quite tedious to do so especially during runtime, Not only that it requires some over head to do so during runtime . Your basic approach would be to generate and store a list …

Member Avatar for Sky Diploma
0
118
Member Avatar for neppy

These questions are actually not C++ questions, they are mainly logical, Infact, The C++ constraints come in only during the use of compound assignments operators, ie: ( +=, -= ,/= etc..) So , Just think over the questions, And I GUESS you will get to the answer easily .

Member Avatar for neppy
0
263
Member Avatar for gretty

Hey a better way would be to delete the particular letter in the string after you encounter it. using the [icode]string::erase()[/icode] function. In the end you will have to just chek if the string is empty(); and then you have a anagram.

Member Avatar for mrnutty
0
519
Member Avatar for Cole

Well , Mr Stroustrup's book "The C++ Programming Language " would give you much insight on the language. keeping in mind that you are already familiar to OOPS it would be worth the effort of reading such a book :)

Member Avatar for northrider
0
156
Member Avatar for esesili

[code] inpa >>(name)>> (visit_duration) >> doctor;[/code] your doctor class does not have a [icode]>>[/icode] operator overloaded, hence the compiler places that error. You can either define the operator, or change the value of doctor through temporary objects and the doctor classes functions.

Member Avatar for Sky Diploma
0
146
Member Avatar for maudits

Lol sometimes you use "VISUAL C" and in other cases "VISUAL C++" which one are you using ?

Member Avatar for maudits
0
295
Member Avatar for mandofl

Well, You have misunderstood the basic concept of a [icode]class[/icode] [code] Employee Name[3] ={ "Susan Meyer", "Mark Jones", "Joy Rogers"}; Employee Idnumber[3] ={ 47899, 39119,81774}; Employee Department[3] = { "Accounting", "IT", "Manufacturing"}; Employee Position[3] = {"Vice President", "Programmer", "Engineer"}; [/code] So by this code you are actually creating about 12 …

Member Avatar for mandofl
0
4K
Member Avatar for trikker

Put in all the cpp files into the Project and leave the header files in the current directory. and then compile

Member Avatar for Sky Diploma
0
502
Member Avatar for zsady

I guess it is just a question of grouping. The Basic Approach would be like this: First you will need to start with sorting the "X" coordinates. After that. Group all the Objects having the same "X" coordinate. After that. In that particular group ... Sort the "Y" coordinates.

Member Avatar for mrnutty
0
105
Member Avatar for slawted

[code] myfile.write << name << "\n" << home << "\n" << mobile << "\n" << adress0; myfile.write << "\n" << postcode << "\n" << email << "\n" << notes; myfile.close(); { else cout << "Unable to open file"; return 0; } [/code] Remove the [icode].write[/icode] and then try the program. …

Member Avatar for Sky Diploma
0
99

The End.