257 Posted Topics
Re: i think the error is the missing [B];[/B] at the end of the class declaration in the header file. [CODE]class Prog { public: void ReadList(int Array[], int N); void Avgs (int Array[], int N, int &Ave, int &aveP, int &AveN); int Large (int Array[], int N); void Display(int Array[], int … | |
Re: >>Then I want to make graphics, ı mean ı want to show moves in Chess Board , are there any source code of this ? Well, there are many Graphic libraries available. Question is, how good do you want them to look? Do you want the Chess pieces to be … | |
Re: Declare a structure as follows: [CODE] struct read_file { char name[100]; int age; } var; fscanf(fp, "%d = %s", &(var.age), var.name); [/CODE] | |
Re: Well, you can try this: 1) Check if it is an Uppercase letter.(Using the ASCII value) 2) If it is, add 32 to it.(convert it to lower case) [URL="http://www.asciitable.com/"]Ascii Table[/URL] | |
Re: Paste the code, of whatever you have tried. We can help you build on that. Well, here is a hint: Let the number be N rev_num = rev_num * 10 + (N % 10) N /= 10 You need to do this till N becomes 0. | |
Re: >>If each number entered by the user is 3.7E+38 / 10, then the average of those ten numbers should never exceed 3.7E+38 correct? Yes, it is correct. Could you elaborate a little more? What problem are you facing? | |
Re: Hint: Use [CODE]cout << a + 1[/CODE] in the inner for loop. | |
Re: Well, you can't use cout to do that. You will have to use other libraries. Here is one: [url]http://qt.nokia.com/products/[/url] | |
Re: Well, the function is basically allocating memory to a bunch of pointers. It can be shown like this: [CODE] [....] means allocate memory to a pointer. ptr1 = [.....] ptr2 = [.....] ptr3 = [.....] ptr4 = [.....] This is done by for(i=MIN;i<row;i++) { arr[i]=malloc(col*sizeof*arr); if(!arr) { printf("\nMemory unavailable"); exit(EXIT_FAILURE); … | |
Re: It depends what type of image you want to read. Reading a bmp file is pretty simple. [URL="http://en.wikipedia.org/wiki/BMP_file_format"]Here[/URL] is the bmp format. | |
Re: @OP Is this what you mean? Use a visited[] array to mark the ones that have already been generated. [CODE]int visited[100]; // to mark visited ones. Let all of the values be 0 initially. int count = 0; // Now, lets try to store 10 unique numbers between 0-99 while … | |
Re: Well, you can try this: 1) Count the number of lines in the file 2) Do this: [CODE] rand_no = rand() % count; // where count is the no. of lines in the line.[/CODE] 3) Now, use a loop to iterate to that line. PS:[URL="http://www.cplusplus.com/reference/clibrary/cstdlib/rand/"]rand()[/URL] | |
Re: Well, you can try this method: This involves extra space though. Algorithm: 1) Extract words into a buffer( i have used a 2D array) 2) Mark indices 3) Swap indices. 4) Print as per indices, so that the words will be swapped. [CODE] char *arr = "hello world bye world"; … | |
Re: Well, i guess you can use threads. But you might have to make sure you make them synchronized. i have never tried doing it, but i guess you can, using threads. | |
Re: [CODE] #include <stdio.h> void value(int *Matrix,int a, int b); int main(void) { int Row1 = 0, Col1 = 0, Row2 = 0, Col2 = 0; int Matrix1[10][10]; // Here. int Matrix2[10][10]; printf("This is matrix multiplication program"); printf("\nEnter the dimensions of two array "); scanf("%d %d %d %d", &Row1, &Col1, &Row2, … | |
Re: [CODE]printf(" a . b = %4.1f\n", dot(a, b));[/CODE] Did you miss this out? i checked the output. i got 1.0 for c.b. That is correct right? | |
Re: Well, you can try 2 things: 1) Ask the user for how many products he wants. 2) Let entering -1 for a product be the end of the product list. ie: 1) [CODE] while ( salesPerson != -1 ) { cout << "Enter the number of products"; cin >> productCount; … | |
Re: OK, you can try this: 1) Reverse the string 2) Reverse each word in it eg: Hello World 1) dlroW olleH --> i guess you have done this part. Now, reverse each word in it For this, try this: [CODE]for (i = 0 to length(string)) { while (string[pos] != SPACE) … | |
Re: Could you elaborate a little more? >> in which even no.s print Do you mean you want to print the even numbers in the array? Also, paste the code you have already written. | |
Re: @OP You could try using scanf() in this way: [CODE] /* enter eqation */ scanf("%dx %c %dx %c %d", &v1, &v2, &v3) ;[/CODE] eg: 1x + 2x - 3 But in this case, you cannot give -x in the beginning as in your example, you will need to enter 1x. … | |
Re: Well you can use Qt. [url]http://qt.nokia.com/products/[/url] You can configure VS for Qt. If it is just a single push button, i suggest you create a small rectangular box with a label on it that says "Press" or something like that. i mean would you like to use an entire framework/library … | |
Hello, im trying to implement a generic double linked list, and i have added just one function(insert). But im getting some errors. Here is the code: [CODE]#include <iostream> #include <cstdio> #include <string> using namespace std; template <typename T> class doubleList { private: struct Node { T info; Node *leftPtr; Node … | |
Re: >>I've tried to Link both of them on Visual studio and Code::Blocks with no succes. Both libraries you mentioned are pretty good. i have tried using ARToolKit (not on my machine, my friend's machine, on VS 2010) and there was no problem. Could you elaborate what exactly is the problem? | |
Re: There you go: i have written where i made the change [CODE]# include <stdio.h> # define MAX 100 int main(void) { int array[MAX],i,n; //printf("\n Enter Array Size: ",MAX); scanf("%d", &n); //Allows user to choose Array Size for(i = 0; i < n; i++) { printf("\n Enter %d value: ",i+1); scanf("\n%d", … | |
Re: Refer Programming Windows by Charles Petzold. An excellent book, and it also has a lot of examples. In fact, there is a sample code too, for drawing text in a Window. i haven't done much Windows programming myself, but i just referred the book. You can use [B]DrawText()[/B] function. | |
Re: Adding to what MosaicFuneral has suggested, you can try this, if this is what you are looking for [CODE] float val = 2.0; // make an unsigned char pointer point to the beginning, then extract all bytes unsigned char *ptr = (unsigned char *)&val; // first byte unsigned char p … | |
Re: OK, from what i understand, you basically need 5 recursive functions: 1) This returns the count. [CODE]compute_digits_count(num) { if (num equals 0) return 0; return 1 + compute_digits_count(num / 10) }[/CODE] 2) The above code finds the number of digits. For the sum, this hint would be enough: Hint: Digits … | |
Re: [CODE]float orientation;[/CODE] So, orientation is a floating point variable. So, how come this : [CODE]orientation.x[/CODE] Or, did you intend it to be [CODE]rot.x[/CODE] instead? | |
Re: Could you paste the code here? Also, i guess you are referring to VS 6.0 . [URL="http://en.wikipedia.org/wiki/Visual_C%2B%2B"]These[/URL] are the versions of VC++. Are you using VC++ 6.0? |
The End.