- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 8
- Posts with Upvotes
- 8
- Upvoting Members
- 6
- Downvotes Received
- 2
- Posts with Downvotes
- 2
- Downvoting Members
- 2
83 Posted Topics
![]() | Re: i think it is easy: 1- you declare 2d array 2- fill it with * 3- declare player1Turn =true 4- declare player2Turn =false 5- make while loop where not finished BS:not Finished would be function return bool that checks the condtions 6-if player1Turn 6.1- player1Turn =false 6.2- player2Turn =true 6.3- … |
Re: i found these two solutions [URL="http://cquestionbank.blogspot.com/2010/08/factorial-of-100-in-c.html"]big array[/URL] [URL="http://sourceforge.net/projects/cpp-bigint/"]bigInt Class[/URL] | |
Re: you need to post your trials to help you ,no one can do your work for you | |
Re: this error: [CODE] cannot convert parameter 2 from 'const char [29]' to 'LPCWSTR' [/CODE] means you use Unicode in project proberties not ansi so you can change it to ansi or just Put L before string [CODE] MessageBox(NULL,L"Release Of DC And RC Failed.",L"SHUTDOWN ERROR",MB_OK | MB_ICONINFORMATION); [/CODE] | |
Re: try to use single binding data source to all the controls(combos and grid) | |
| |
Re: you have 2 options: 1- use pointer and return Null and check on it 2-return vector<string> and check on size and for recursive part: [CODE] // Search subdirectory vector<string> tmp = SearchDirectory(FilePath, FileExtension, SearchSubdirectories); //Recursive call.. Not sure if I'll overflow the stack here.. Any better ways to do this? … | |
Re: this code has alot of issues so please if you donot want to paste all of your code (that is better) start with simple example that can compile and what is sleep(1)?? sleep for 1 mille sec | |
Re: it printed 2 cause u didnot reset v1 try this [CODE] int ans = 0, v2 = 8, v1 = 5; ans = v2 % v1++; cout<<(ans); //This prints out 3.. v1=5; //when you remove this line v1=6 cout<<(v2 % v1++); //This prints out 3 not [COLOR="Red"]2[/COLOR].. cin.get(); [/CODE] | |
Re: are you sure there is no any other print in the other functions that prints the 2 or 5?? please debude your code to figure out what prints the 2's or it could be that queue function takes pId by ref and changes its value to make sure that ++ … | |
Re: 800a0035 error for not found file so you need to register the com dll at the new machine use "regsrv32 FullPath\ComName.dll" command first | |
Re: you need to solve your hw to learn and it is not an advanced question. but we can tell you how to think gust tell us what is the string1 data type | |
Re: you print the result of sum ,what you need is not the sum so instead of doing sum operations in recurse function print the number | |
Re: i am sorry i got lost let me try simplify it: Pointer variable holds address ok? EX: [CODE] int x=0;//x Value=0, x Address in memory EX:(32Bit)0016F8C8 int y=1;//y Value=1, y Address in memory EX:(32Bit)0016F8BC int*p=&x;//p Value=0016F8C8 p Address in memory EX:(32Bit)0031F9F0 //p Value is (Addressof x) cout<<&x<<" " <<&y<<" " … | |
Re: cause when you erase the size changes and i looks at new pos [CODE] if(ispunct(string1[i])) { string1.erase(i,1); i--; } [/CODE] | |
Re: try this [CODE] int add(int num1,int num2) { return num1+num2; } int sub(int num1,int num2) { return num1-num2; } void test(int (*ptr2Func)(int, int)) { int res=ptr2Func(1,2); } void callTest() { test(&add); } [/CODE] | |
Re: [QUOTE=;][/QUOTE] this will not do the job please try it : recheck: 1-this will add only single item not H 2-and if 2 items are in row will doplicate the first only 3-and will crash if inal item is match | |
Re: it is simple: [CODE] #include <iostream> struct Point{ int X; int Y;}; typedef Point* PointsArr; static const int size=100; void main() { PointsArr test=new Point[size]; memset(test,0,size*sizeof(Point)); for(int i=0;i<size;i++) { test[i].X=i*2; test[i].Y=(i*2)+1; } for(int i=0;i<size;i++) { std::cout<<test[i].X<<" "<<test[i].Y<<std::endl; } } [/CODE] | |
Re: simple: [CODE] int main() { node *head = new node; [COLOR="Red"]//head = NULL;[/COLOR] node *temp = head; //node 1 temp->data = 1; temp = temp->next;// temp->next is null; //node 2 [COLOR="Green"]temp = new node;[/COLOR] temp->data = 2; temp->next = NULL; //traverse temp = head; while(temp != NULL) { cout << … | |
Re: i donot know what is DSP but there are alots of libraries for image/video processing in c/c++ like openCV,imagemagic | |
Re: i didnot follow all the code back but i found that the assign is not true when you enter "10" as two digits it is stored in single digit??and if i enterd 10000000 also in single cell? | |
Re: follow this [URL="http://stackoverflow.com/questions/1565142/what-is-the-simplest-way-to-display-and-change-an-image-resource-on-a-wpf-dial"]http://stackoverflow.com/questions/1565142/what-is-the-simplest-way-to-display-and-change-an-image-resource-on-a-wpf-dial[/URL] | |
| |
Re: Can you explain the senario you want to implement like: 1- call bgw 2-stop bgw 3-change 4-..... X- end so we can help | |
Re: 1-To send variable from one form to another just declare public variable in the target form and set it in the instance 2-no you cannot you will need to use richtextbox | |
Re: just print them [CODE] infile >> studentNames[count] >> wins[count] >> losses[count]; [COLOR="Red"]cout<< studentNames[count] << " " << wins[count]<< " " << losses[count]<<endl;[/COLOR] count++; [/CODE] | |
Re: The Header (test.h) [CODE] //Donot include the cc class test{ public: void sayHello(); }; [/CODE] the test.cc [CODE] #include <test.h> #include <iostream> using namespace std; void test::sayHello() { cout<<"Hello\n"; } [/CODE] the target class(target.cc) [CODE] #include <test.h> class target{ public: void callTest() { test t; t.sayHello(); } } [/CODE] | |
Re: you will need to override equals in the struct [CODE] struct node { public int x; public int y; public int cost; public object parent; public override bool Equals(object obj) { bool res = false; if (obj.GetType()== typeof(node)) { node objCasted = (node)obj; res=objCasted.x == x && objCasted.y == y; … | |
Re: declare [CODE]char chars[8];[/CODE] then in each case [CODE]...digit[w] = X;chars[w]=letter; break;[/CODE] finally [CODE] for (int w = 0; w < 8; w++) { cout << chars[w]; } for (int w = 0; w < 8; w++) { cout << digit[w]; if (w == 3) cout << "-"; } [/CODE] | |
Re: if struct/class doesnot mater you use class and it will solve the problem | |
Re: you can use qsort with you custom function | |
| |
Re: 1-in header files you typed [CODE]using namespace std;[/CODE] this need to be used only if you add [CODE]#include <iostream>[/CODE] or any other class that include std namespace so delete this line as it is not necessary(in headers) 2-some implemented functions doesnot have return type so write it eg:[CODE](CheckingAccount::debit(double sub))[/CODE] 3-this … | |
Re: [CODE] else { for (int col = 0 ; col < width ; col++) { for (int row = 0 ; row < height; row++) { if(col==0||row ==0||col==width-1||row==height-1) cout<<"*"; else cout<<" "; } cout<<endl; } } [/CODE] | |
Re: can you elaborate what you want exactly!! with some code effort | |
Re: i didnot found your problem can you tell us the senario of the error | |
Re: 1-There is no (inFile,product)?? 2-while (getline -->will skip the whole file not the comment [CODE] //skip the comments while (getline(inFile,product)) { if (product[1] = '!') cout << product << '\n'; } [/CODE] | |
Re: for (int i = 0; i < AddressBook.GetLength(0); i++) { for (int j = 0; j < AddressBook.GetLength(1); j++) { if (AddressBook[i, j].Equals(SearchInput , StringComparison.OrdinalIgnoreCase ) ) } } | |
Re: bacareful you had declared s3 twice | |
Re: i hope this could be helpful [CODE] #include <iostream> using namespace std; class A; class B{ A *obj; public : B(){obj=0;} ~B(){if(obj)delete obj;} void helloFromA(); }; class A{ public : void hello() { cout<<"hello from A"<<endl; } }; void B::helloFromA() { if(!obj) { obj=new A();; } obj->hello(); } [/CODE] | |
Re: 1-actually you used single variable and two methods 2-the main usage is validation Ex: [CODE] class myCustomInt { int minVal,maxVal; int _CurrVal; public int CurrVal { get {return _CurrVal;} set { if(value>=minVal &&value<=maxVal) _CurrVal=value; } } public myCustomInt(int ValidMax,int ValidMin) { minVal=ValidMin; maxVal=ValidMax; _CurrVal=ValidMin; } } [/CODE] | |
Re: the question is not clear and you are using pictureBox1 in move and resize and pictureBox2 in save | |
Re: i think you need this [CODE] if (first == NULL) //first case init { first = newNode; last = newNode; } else { if(first->info.id>newNode->info.id) { newNode->link = first; first= newNode; } else { nodeType *temp=first; while(temp!=null && temp->link!=null) { if(temp->link->info.id>newNode->info.id) { newNode->link=temp->link; temp->link=newNode; break; } temp=temp->link; } if(temp==null) { last->link … | |
Re: every time you call this function each member(Score,Average,ScoreTotal,myScoreList) will be cleared (as you start over) to avoid this declare variables you need to keep its values out side the AddScore_Click function or declare as static | |
Re: here is the problem [CODE] for (int i = size1; i < newSize; ++i) for (int j = 0; j < size2; ++j) for (int c = 0; c < size1; ++c) if (array1[c] != array2[j]) unionArray[i] = array2[j]; [/CODE] this code is not correct as logic and as result … | |
Re: First set the smallest and secondsmallest to int_max [CODE] int Smallest_Value = INT_MAX; int Second_Smallest_Value = INT_MAX; [/CODE] then you need to set the second smallest then the first like this: [CODE] cin >> Integers[i]; if(Integers[i]<Smallest_Value ) { Second_Smallest_Value =Smallest_Value; Smallest_Value=Integers[i]; } else { if(Integers[i]<Second_Smallest_Value ) { Second_Smallest_Value =Integers[i]; } … | |
Re: nice work but you can do better 1-try to add more functions (donot put all the code in main) 2-it would be nice if you clear the screen every itr. 3-to avoid misstype input crash try to get width as string then convert to int | |
Re: to convert static array to dynamic Ex: [CODE] //static int c[1]; //dynamic int *c=new int[1]; //or int *c=(int*)malloc(1*sizeof(int)); //and allways remember to delete all the memory you dynamically allocate delete [] c; [/CODE] i hope this was useful | |
Re: first of all i need to say there is a lot of code here which is not neccessary and need optrmization so try to edesign your code but for your problem try this.Invalidate() |
The End.