121 Posted Topics
Re: 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] | |
Re: 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 … | |
Re: 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 … | |
Re: Hello drongo, In your function calling you didn't mention all the parameters. You didn't give the char* parameter. | |
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. | |
Re: [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 … | |
Re: 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 … | |
Re: You should have made a discussion thread not a poll. | |
Re: 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 ? | |
Re: Hello sing1006, You haven't initialized count1 in the main() and count can be used only in the main() (local scope). | |
Re: 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] | |
Re: Hello wakesta, You are using getch() and gotoxy() functions functions, but you haven't included conio.h. | |
Re: 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] | |
Re: Hello alex1050, Try giving if-else statement for '-' also. I think then it would work. | |
Re: 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. | |
Re: Hello alex1050, In the line 15 it looks like '\o'(letter 'o') it should have been '\0'(zero). | |
![]() | Re: 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 … ![]() |
Re: 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 … | |
Re: Hello cse.avinash, There is no return statement on the function fun. | |
Re: 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] | |
Re: 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. | |
Re: 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 … | |
Re: [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] | |
Re: >>Ancient dragon [CODE]int readVal(struct Telem* tm)[/CODE] Can you explain this ? because telem is itself a structure. sorry.. Got it. | |
Re: 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 … | |
Re: Hello salty11, There is a semicolon after for loop. You have terminated the loop. [CODE]for(i=1; i<=N; i++);[/CODE] | |
Re: 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. | |
Re: 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 … | |
Re: 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. | |
Re: 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] | |
Re: 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. | |
Re: 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 … | |
| |
Re: 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] | |
Re: 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. | |
Re: 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 … | |
Re: 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. | |
Re: 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. | |
Re: 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++. | |
Re: 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 … | |
Re: Hello nory22, You just have to change the condition in the if statement. For example [CODE]if(choice=='R' || choice=='r') { }[/CODE] | |
Re: 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. | |
Re: 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 | |
Re: 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] | |
![]() | Re: 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. ![]() |
Re: 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] | |
Re: 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 … | |
Re: 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 … | |
Re: 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. | |
Re: 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. |
The End.