49,757 Topics
| |
Hey guys! I've got a small problem that I can't figure out. I have 2D arrays of arbitrary sizes, and they contain different characters representing different stuff (like 'a', 'b', 'c' etc.). Now, the problem is, I need to find horizontal and vertical lines of same characters and make new … | |
[CODE] #include<iostream> using namespace std; void comparison(char arr2[], char arr3[],int& i,int j) { int abc=1; for(j=0;j<5;j++) { if((arr2[j]==arr3[j])||(arr2[0]!=arr3[0])) { j++; } i=i+1; j=5; } } int main() { char arr[5]={'a','b','c','d','e'}; char arr1[5]={'a','b','c','d','e'}; int refr=0, iteratorr=0; comparison(arr,arr1,refr,iteratorr); for(iteratorr=0;(iteratorr<5&&refr==1) ;iteratorr++) { cout<<arr1[iteratorr]<<endl; } return 0; } [/CODE] //Can anyone help me figure … | |
I've been racking my brain on this for hours. The goal of the program is to estimate the value of pi using three different formulas. My arithmetic is fine, I've tested it, and if it is wrong, I can correct that easy. The problem is that my if statements don't … | |
i'm new in C++ programming 1 problem comes in fuction .it's result is correct but it return the value 0 also,if i'm not use return 0; in functionin it print any value plz check this .and correct.thanx[code] #include<conio.h> #include<iostream.h> #include<iomanip.h> int mul1(int x[][3],int y[][3]) { int i,j,k,sum,z[3][3]; for(i=0;i< 3;i++) { … | |
Hi all. I am trying to build a Binary Linked Trie but fail in basic pointer operations.Following code can be built but in debug or run mode, it breaks and outputs the error. [ICODE]typedef struct node { char ch; node *next; }; struct node *root = NULL; void add(struct node … | |
Hi! :) I want to print all different elements of sorting array. input: 10 10 5 4 output: 10 5 4 :-/ Thank you! | |
Hello. First, here is my code: [CODE] class BankAccount { private: int accountNum; double balance; public: bool setAccountNum(int num); int getAccountNum() const; double getBalance() const; void depositMoney(double money); bool withdrawMoney(double money); void displayAccount() const; BankAccount(); }; class SavingsAccount: public BankAccount { private: int accountNum; double sBalance, rate; public: void setInterest(double … | |
Hi, I need to sort a string of symbols and numbers in to two different strings, first one with numbers, second with symbols. I have written the following code, but it only passes the first type into its string and gives random characters for the second type. Example: if i … | |
[B]Note: see lines 26-28 in ResistorMain.cpp file this is pertaining to my question[/B] Note: driver file ResistorMain.cpp was given to me as well as some of the functions in Resisitor.cpp. I keep running around this and cannot seem to get this one part to compile correctly. This code requires a … | |
hi i am new to [B]socket programming[/B] and we have to do a project in a month. can u suggest some good project objectives which will look on CV. any help is highly appreciated. | |
I have mentioned the code for checker board made on visual studio .I dont know whats the problem with this code .. it just draw only one row of checker board on the drawing window :( help me //#include <windows.h> // use as needed for your system //#include <gl/Gl.h> #include<stdlib.h> … | |
Hello all! I have exactly the same problem as in stackoverflow: [url]http://stackoverflow.com/questions/6442550/problem-with-makefile-and-gtkmm[/url] There they don't find any solution, so I hope you can help me. The problem is that when I compile in my terminal with: g++ main.cpp -o output `pkg-config --cflags --libs gtkmm-2.4` The compilation goes fine. When I … | |
hi please I need help how to sort int line by line & get number of int in each line I have Input 4 2 32 8 6 10 7 9 21 2 3 14 1 5 Output must be 2 4 6 8 32 count = 5 2 3 … | |
I made a snake game using only its native language...I use the _getch() function to get whatever the user pressed and I used also the system("cls") to clear whenver the head of the snake moved. I actually made it move by the use of 2dim arrays but I have a … | |
Hello all. I am working with windows forms in c++/cli. I am trying to use a tabpage control. When i have a background image behind my tabs, the tabs will flicker when i click on them. I have read about using this in my forms main constructor. [CODE] this->DoubleBuffered = … | |
I Want To Make A Utility Like The Old DOS Command "rdisk" In C++. The Things I Want It To Be Able To Do Are: WIN: Be Able To Specify The Drive Letter (Like rdisk's /:Z) UNIX: Be Able To Specify The Mount Point (/mnt/rdisk or /media/somthing, etc) BOTH: Make … | |
how can i check if the number is positive or not by using switch statement please who know the answer help me and answer the question | |
what I'm pretty sure I learned in school and what like every website said when I tried to look this up online was that the C++ code for generating a random number with floor: 1 and ceiling 100 (err I guess 101) is: [CODE]int number = rand() % 100 + … | |
A black-hat cracker attacked to your computer and he took a very important sequence from it. Also, he replaced this sequence with five mutations of the sequence. The sequence has length of N and it's content are numbers between 1 and N (all the numbers one time) in a random … | |
Hello! I have created a ChatClient in Visual C++ 2010 Express, cmd console only. Now I want to make it in Windows Form Application. I have come a long way but the thread function to start a new thread is a bit of a problem.. I get these errors: error … | |
This function of this find the median of three values inside an array. I was wondering if there's a more elegant solution to finding the median value between 3 values. [CODE] int mid =((p+r)/ 2); if(V[p]<V[r]){ if(V[p]<V[mid]){ if(V[mid]<V[r]) swapfunc(V[mid],V[r]); } else swapfunc(V[p],V[r]); } else{ if(V[r]<V[mid]){ if(V[p]<V[mid]) swapfunc(V[p],V[r]); else swapfunc(V[mid],V[r]); } … | |
So I've currently been studying C++ independently for a couple weeks with the help of good old books. One of the exercises was to make a "games library" where you can see your list of games, add a title, or delete it (has nothing to do with games). The catch … | |
How do you convert a System::String to const TCHAR*? | |
Hi everybody, I have a problem with Opencv. I have to recognize some object in a image. The problem these object is attached,tangent. So I tried a lot of solutions but nothing works fine. Here is my code: [CODE]... IplConvKernel * kernel = cvCreateStructuringElementEx(2,2,0,0,CV_SHAPE_RECT,0); IplConvKernel * kernel2 = cvCreateStructuringElementEx(3,3,0,0,CV_SHAPE_ELLIPSE,0); cvThreshold(image,image,80,255,0); … | |
Hi, I am currently newbie in C++, I just learned it for around 2 weeks, My question is when I put the number, it shows if it's a prime number or not. The only problem when I put 2 and 3, it supposed to be prime numbers, but the fact … | |
Hello everyone, I wanted to implement AES encryption technique to encrypt text file of any size. but for large size my compiler crashes.could anyone solve my problem problem is in line 304 according to me I attached my code with this thread plz help me asap. | |
Hello guys, Ron here...im going to start my IT lessons next year but I already started learning some basics in C++...actually, I tried making a Hangman game already but there's something wrong...My loop is incorrect...please help me...so here is my first ever code.. #include<iostream.h> #include<conio.h> #include<stdio.h> #include<math.h> void main() {char … | |
Can someone give me some resources (books, online tutorials, etc.) on algorithms for 2D collision detection? I've searched a little, and all the ones I can find are for 3D collision detection. Thanks in advance. EDIT: Just to clarify, I know [I]how[/I] to do collision detection, just not efficiently. | |
| I am getting an error during the build stating: "Illegal call of non-static member function" and I cannot figure out 1) what does this mean, or 2) how to resolve it. For detailed clarification, I will type out what the assignment was (I say was because the assignment was due … |
Hi friends, I am new for C++. Please answer my questions [LIST=1] [*]How to write a Multiple COM Port at same time? Is it Possible?How? Please give a Code [/LIST] In My Program,I declared a Object like this [CODE] struct _DCB dcb; HANDLE hCom; [/CODE] [LIST=2] [*] What is mean … |
The End.