257 Posted Topics

Member Avatar for icasta13

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 …

Member Avatar for jonsca
0
218
Member Avatar for mg120

>>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 …

Member Avatar for msaqib
0
223
Member Avatar for bojomojo

Declare a structure as follows: [CODE] struct read_file { char name[100]; int age; } var; fscanf(fp, "%d = %s", &(var.age), var.name); [/CODE]

Member Avatar for bojomojo
-1
144
Member Avatar for Mona..

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]

Member Avatar for Narue
0
201
Member Avatar for gahhon

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.

Member Avatar for myk45
0
195
Member Avatar for FutureWebDev

>>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?

Member Avatar for FutureWebDev
0
185
Member Avatar for benny2010
Member Avatar for bookmark
Member Avatar for johngalt10

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]

Member Avatar for jonsca
0
97
Member Avatar for Joey_Brown

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); …

Member Avatar for Trentacle
0
150
Member Avatar for MacImg

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.

Member Avatar for myk45
0
84
Member Avatar for alexchen

@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 …

Member Avatar for ravenous
0
18K
Member Avatar for alexchen

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]

Member Avatar for alexchen
0
1K
Member Avatar for lmytilin

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"; …

Member Avatar for myk45
0
2K
Member Avatar for SoulReaper1680

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.

Member Avatar for SoulReaper1680
0
172
Member Avatar for natha_peepli

[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, …

Member Avatar for myk45
0
243
Member Avatar for becka221

[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?

Member Avatar for becka221
0
99
Member Avatar for 07tr0wa07

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; …

Member Avatar for 07tr0wa07
0
176
Member Avatar for techie929

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) …

Member Avatar for gerard4143
0
132
Member Avatar for zartasha*

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.

Member Avatar for jonsca
0
68
Member Avatar for danyesu86

@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. …

Member Avatar for myk45
0
100
Member Avatar for pato wlmc

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 …

Member Avatar for myk45
0
3K
Member Avatar for myk45

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 …

Member Avatar for griswolf
0
156
Member Avatar for pato wlmc

>>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?

Member Avatar for myk45
0
303
Member Avatar for TrueCoding

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", …

Member Avatar for Adak
0
106
Member Avatar for kapilsolanki84

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.

Member Avatar for WolfPack
0
216
Member Avatar for hadoque

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 …

Member Avatar for hadoque
0
167
Member Avatar for enchuk

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 …

Member Avatar for enchuk
0
112
Member Avatar for Tiancailee

[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?

Member Avatar for Tiancailee
0
132
Member Avatar for kdcorp87

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?

Member Avatar for Fbody
0
402

The End.