121 Posted Topics

Member Avatar for fclopez

Hello fclopez, You have missed some ',' in the line 16. Make sure that you didn't miss them in the program. [CODE]fscanf(fp,"%c %c %f %c %c %c %f %c" &rec, &equal0&rxThoughput, &RXunit, &trans, &equal1, &txThroughput, &TXunit);[/CODE]

Member Avatar for jonsca
0
484
Member Avatar for choboja621

You can use graphics.h for drawing shapes(faces especially). There are many inbuilt functions in graphics.h. Some are rectangle,circle,line,ellipse etc,. [QUOTE]Sites, Sample Programs, and just about anything connected to it.[/QUOTE] Well there are plenty of sample programs in the net. The one below will draw a circle. Hope you are using …

Member Avatar for Arbus
0
81
Member Avatar for gladtoplay5

Hello gladtoplay5, You are getting that because you have used the || logical operator. It should have been &&. [CODE]if(weight <= 24.9 || weight >= 18.5){ cout << "Your BMI is " << weight << " you are average." << endl; getch(); return 0; }[/CODE] Here if you give 16 …

Member Avatar for WaltP
0
102
Member Avatar for drongo

Hello drongo, In your function calling you didn't mention all the parameters. You didn't give the char* parameter.

Member Avatar for drongo
0
150
Member Avatar for Arbus

Hollywood's first movie studio was established in 1912. It will be celebrating it's 100 years jubilee next year. My favorite Hollywood movie is Rocky series and favorite heroes are Arnold schwarzenegger, Sylvester stallone. Post your favorite movie and the way it has affected your heart.

Member Avatar for predator78
0
206
Member Avatar for hawita

[QUOTE]So far this is what i have and i am stuck because i do not know how to find when the derivative goes from negative to positive or from positive to negative.[/QUOTE] You need to store some data(altitude and time) in change.dat when velocity becomes negative. I htink this is …

Member Avatar for jonsca
0
190
Member Avatar for Labdabeta

Hello Labdabeta, I hope you are asking to convert the string into integer(binary number) and then converting it to decimal. If yes,try this one.. For example, if there is '1' in a[0] then subtracting a[0] and '0' will give 1. [CODE]int b; char a[100]; b=a[0]-'0';[/CODE] The ASCII value of '1'(which …

Member Avatar for nezachem
0
154
Member Avatar for Sahilroy
Member Avatar for GhostMonkey

Hello ghostmonkey, In line 19 you didn't assign the value. You have used == . Is that a mistake due to your typing ? Why can't you use another integer array for storing zeros and a variable to count the number of zeros ?

Member Avatar for L7Sqr
0
1K
Member Avatar for sing1006

Hello sing1006, You haven't initialized count1 in the main() and count can be used only in the main() (local scope).

Member Avatar for Fbody
0
186
Member Avatar for marrkee

Hello markee, ASCII value of character 0 is 48 and '1' is 49. When you subtract these ASCII values you will get the required value 1. For example, [CODE]char a; int b; b=int(a)-'0';[/CODE]

Member Avatar for marrkee
0
123
Member Avatar for Wakesta

Hello wakesta, You are using getch() and gotoxy() functions functions, but you haven't included conio.h.

Member Avatar for Wakesta
0
208
Member Avatar for sms5660

Hello sms5660, In the line 59 you have passed a parameter to the function option1(). But in the declaration of the function , you didn't make the function to accept integer values. [CODE]cout << option1(yearsUntilRetirement);[/CODE]

Member Avatar for sms5660
0
134
Member Avatar for alex1050

Hello alex1050, Try giving if-else statement for '-' also. I think then it would work.

Member Avatar for alex1050
1
281
Member Avatar for ThrasherK

Hello ThrasherK, I hope [COLOR="black"]coursename[/COLOR] is a string. In the line 10 you have declared [COLOR="black"]coursename[/COLOR] as character variable. Declare it as a pointer or as a character array.

Member Avatar for ThrasherK
0
171
Member Avatar for alex1050

Hello alex1050, In the line 15 it looks like '\o'(letter 'o') it should have been '\0'(zero).

Member Avatar for alex1050
0
85
Member Avatar for FrancisLazo

Hello francis25, consider a set {2,2,2,2,2,2,2}, to find the sum of all elements in the set, you would count the number of 2's and multiply it with 2. You can also add all the 2's instead of multiplying and that's what is done in the code you posted. Variable i …

Member Avatar for FrancisLazo
0
157
Member Avatar for tricket_7

Hello tricket 7, Already you have found the month with highest and lowest rainfall. So instead of giving highest in line 53 give months[highest]. Note that January will be in months[0]. So if highest is 1 then it will print February rather than January. You will have to make some …

Member Avatar for tricket_7
0
653
Member Avatar for cse.avinash
Member Avatar for mitrmkar
0
1K
Member Avatar for thecodepixie

Hello thecodepixie, In the for loop in line 37 use some if-else statements. For example [CODE]if(grid[i][j]==0) {printf(" "); } else {printf("%d ",grid[i][j]); }[/CODE]

Member Avatar for Arbus
0
164
Member Avatar for itslucky

Hello itslucky, You can do as gerard4143 said or you an also do this. Declare a character array. The values in the character array can be converted to integers by doing this. [CODE]char a[5]="2358"; int a; a = ((a[0]-'\0')*1000))+((a[1]-'\0')* 100))+((a[2]-'\0')*10)+(a[3]-'\0'); [/CODE] Variable 'a' will have the integer 2358.

Member Avatar for Arbus
0
135
Member Avatar for shyla

Hello shyla, You didn't enclose the for loop with braces on line 30. [CODE]cout << "Your string reversed: "; for (int count = 0; count < strLength; count++) cout << reverse(myString, strLength); cout << myString[count] = tolower; [/CODE] Since you didn't do that, it will print the string sent by …

Member Avatar for Arbus
0
1K
Member Avatar for spixy

[QUOTE]i've tried it, but i cant work on putting them together... [/QUOTE] Hello spixy, You have combined matrix addition and multiplication. Do them separately and there is no need of loop k. [CODE]c[i][j]+=x[i][k]*y[k][i];[/CODE]

Member Avatar for spixy
0
2K
Member Avatar for Sotiria Sotiria

>>Ancient dragon [CODE]int readVal(struct Telem* tm)[/CODE] Can you explain this ? because telem is itself a structure. sorry.. Got it.

Member Avatar for Ancient Dragon
0
589
Member Avatar for winecoding

Hello winecoding, You can pass 2d arrays as pointers. [CODE]int func(int **array1);[/CODE] The function can now get a 2d array. or You can also pass arrays to a function like this. [CODE]int func(int a[][100]);[/CODE] The size of the column should be given. You can call the function in the main …

Member Avatar for Arbus
0
686
Member Avatar for salty11

Hello salty11, There is a semicolon after for loop. You have terminated the loop. [CODE]for(i=1; i<=N; i++);[/CODE]

Member Avatar for PathikRaval
0
337
Member Avatar for Tamlyn

Hello tamyln, The problem lies with your calcactualamount funciton. You gave return amountp in a while loop. It's wrong. You should give return statement outside the loops. A function can return only one float value. Use code tags.

Member Avatar for Tamlyn
0
382
Member Avatar for Khoanyneosr

Hello khoanyneosr, I think you gave wrong function prototype for game function. Try giving this in your function definition. [CODE]int game(string soFar, const string THE_WORD, int MAX_WRONG, int wrong, string used) { }[/CODE] Try this as your prototype. [CODE]int game(string,const string,int,int,string);[/CODE] or Try declaring the variables soFar etc., again in …

Member Avatar for Khoanyneosr
0
280
Member Avatar for Xeno86

Hello xeno86, Use fflush(stdin) before scanf for again as charley bones said. The loop doesn't work because as you press enter('\n') the '\n' is copied onto the variable again. You can also use flushall() before the scanf() for again.

Member Avatar for Xeno86
0
174
Member Avatar for digitup1

Hello digitup1, It gives zero because the time taken to do [COLOR="black"]quicksort[/COLOR] function is so small. To test that your time function works right use some loops in your code to make time delay. For example like this... [CODE]long int c; for(c=1;c<=100000;c++) {cout<<" "; }[/CODE]

Member Avatar for template<>
0
191
Member Avatar for TailsTheFox

Hello tailsthefox, System("DIR") will display the directories of the drive and the number of free space available in bytes. But before doing system("DIR") you must change to the required drive. You need to include stdlib for executing system commands.

Member Avatar for TailsTheFox
0
134
Member Avatar for plang007

Hello plang007, In your calculator function you are passing the variable 'a' which is altered in the if else block above it. You are not passing the positive value which the user entered. Thats why you get 1 as the largest number when the user enters 2. [CODE]if ( a%2 …

Member Avatar for Arbus
0
234
Member Avatar for yuyumerry
Member Avatar for pdenman

Hello pdenman, Reset trycount and guess in the starting of the do-while loop. [CODE]do {trycount=0; guess=-1; while(guess!=number && trycount<8) //the code you posted }[/CODE]

Member Avatar for pdenman
0
2K
Member Avatar for n3red

Hello n3red, According to your code each character in the string character array will be changed to upper case. Your code will not change the first character of the string to white space.

Member Avatar for Narue
0
327
Member Avatar for rjbrjb777

Hello rjbrjb777, Try this... Create a structure with variables dd(for day) and mm(for month). Assign the variables with the values you calculated in the function calday and return the structure instead of 'day' only. [CODE]struct cal {float dd ,mm; }; cal daymonth,daymonth2; int calday(float day,float month) { if(month==2) //code as …

Member Avatar for rjbrjb777
0
162
Member Avatar for nory22

There are some special characters like '' which we use for '\n' etc. If we leave a space then the compiler will not recognize it as a special command and just treats it as a character in a string.

Member Avatar for Narue
0
137
Member Avatar for ntrncx

Hello ntrncx, Lets take 67. 67 mod 10 will give you the ones place(7). Then divide 67 by 10. Since both are integers you will get the tenths place(6). Do this for 128 also and you will have the digits separated out.

Member Avatar for ntrncx
0
208
Member Avatar for taumang

Hello taumang, Your if statement is missing and i think you might have got the error "Misplaced else" and your while loop will print x infinite times (x=x+1 will not be done at all).[COLOR="black"] cout[/COLOR] is given as [COLOR="black"]cout<<[/COLOR] in c++.

Member Avatar for taumang
0
108
Member Avatar for Tinee

Hello tinee, You have given [COLOR="black"]while(j-1>=0)[/COLOR]. It should have been j>=0 (note that j=j-1 should be given just before the while loop in the main) because every time after decrementing the loop checks j-1>=0(which is like decrementing twice though not decremented actually) and you get only half the values you …

Member Avatar for Arbus
0
177
Member Avatar for nory22

Hello nory22, You just have to change the condition in the if statement. For example [CODE]if(choice=='R' || choice=='r') { }[/CODE]

Member Avatar for Arbus
0
186
Member Avatar for Helmyano

Hello helmyano, Constructors are not inherited. You have to define a constructor in the derived class also. The base class default constructor (the constructor with no parameters) and its destructor are always called when a new object of a derived class is created or destroyed.

Member Avatar for caut_baia
0
110
Member Avatar for mxrider

Hello mxrider, You are using call by value method in bvolume function. So the values you give using boardLength,boardWidth, maxVolume, SqrSide will not be changed by bvolume though you declared those variables globally. Use call by reference(&) method

Member Avatar for ravenous
0
146
Member Avatar for ntrncx

Hello ntrncx, I think there is something wrong here [COLOR="Green"]testpalindrome(word,last-1,start+1);[/COLOR] It should be last-- and start++ because last and start do not decrement or increment in [COLOR="black"]last-1 or start+1[/COLOR]

Member Avatar for ntrncx
0
363
Member Avatar for anu07

Hello anu07, strcmp wil return value 0 if both the strings are equal.You should check whether strcmp(temp,exit)==0. If you give [COLOR="black"]if(strcmp(temp,exit))[/COLOR] it will break at the first time itself.

Member Avatar for anu07
0
428
Member Avatar for subith86

Hello subith86, Declare a pointer variable and use it to store the address of the char variable p. [CODE]char *b,p='a'; b=&p; cout<<&b;[/CODE]

Member Avatar for subith86
0
322
Member Avatar for hous3aholik

Hello hous3aholik, This is where you got wrong.You declared playerchoice as a character variable and you are assigning integer 0 to it in the switch cases. [CODE]char playerChoice; playerChoice = 0;//<--[/CODE] So you cannot compare it with integer values in the winner() function and the parameters in the winner function …

Member Avatar for VernonDozier
0
2K
Member Avatar for blee93

Hello blee93, I think there is something wrong with the ispalindrome function. For example take 101 * 101=10201. 10201 is a palindrome. In you function isplaindrome first will have zero if 10201 is divided by 100000. Sixth will have 1 (10201 % 10). First is not equal to sixth. So …

Member Avatar for blee93
0
111
Member Avatar for DoubleH

Hello doubleh, If your linked lists are done by using classes, then you can use destructors to destroy the values of student with percentage less than 30.

Member Avatar for NathanOliver
0
184
Member Avatar for slygoth

Hello slygoth, You have declared str as [COLOR="black"][COLOR="black"]char str[/COLOR][/COLOR] in [COLOR="Green"]main()[/COLOR]. Declare it as a pointer.

Member Avatar for slygoth
0
213

The End.