51,593 Topics
![]() | |
[CODE] this is my program could somebody help plz #include <iostream.h> #include <string> using namespace std; typedef int ComponentType; struct CropType { string crop; string farmer; string color; }; CropType myCrop; struct TreeNode { CropType info; TreeNode* left; TreeNode* right; }; void Insert ( /* in */ ComponentType item); void … | |
Hey wizeguys, I am using windows XP and have VC++ 2008. I can make a simple GUI window and write text and add menus and all that n00bish crap. I want to move further. Firstly, i atleast want to know how to change the color of the text that we … | |
ok, so visual C++ is not C99 compliant, but I was wondering how can I access fixed bit length integer types as the one defined in stdint.h (intN_t). thx in advance | |
Hi everybody I have a probleme with my console programe So, I have a void in My DLL , [CODE]void Mytest (LPCSTR files, int* erreur) { ..... ...... }[/CODE] Now I Import this function in my console Programe [CODE]extern "C" __declspec(dllimport) void Mytest (string files, int* erreur)[/CODE] but when i … | |
Hello, I am to draw a cylinder, so I thought I should start learning to draw an ellipse first, can anyone please help me with the algoritm at least, or if you have an explained code I would be grateful. BTW i am using borland C++ for dos version 3.1 … | |
Hey, What i'm trying to do is to use the string.find command with a pointer. Here is the code that i've written sofar. [code] #include <iostream> #include <string> using namespace std; int main() { string one[3]; string two[3]; string searchalt; string *point; int search[3]; int a = 0; size_t found; … | |
so, to be honest, I'm a student at drexel. I have a comp sci problem. My program works fine except for: [code] if (stuAns[i]!="A" || stuAns[i] !="B") { i--; cout<< "Your answer must be capital A or capital B"<<endl; } [/code] this is embedded in a for loop. Also, it … | |
Hey, thanks in advance for any help! I need to search a file for a specific word starting on a newline then skip a SPACE and read the next word into a char array or string, and then skip a word and read the next word, stopping at the next … | |
Hi All, The gap between consecutive prime numbers 2 and 3 is only 1, while the gap between consecutive primes 7 and 11 is 4. Can somebody help me in writing a parallel program to determine, for all integers less than 1,000,000 , the largest gap between a pair of … | |
Your country is at war and your enemies are using a secret code to communicate with each other. you have managed to intercept a message that reads as follows: :mmZ\dxZmx]Zpgy The message is obviously encrypted using the enemy's secret code. You have just learned that their encryption method is based … | |
can anyone help me write the code for the below situation using c-string? i'm cracking my head wif tis..... title: Word Processor Write a program to perform the following 3 functionalitiees. 1.Function to replace a misspelled word with a correct one. the keyboard input specification are: --the name of the … | |
[CODE] #include<stdio.h> class q1 { int id; public: q1() { id = 1; printf("mkdef: %d\n", id); } q1(int start) { id = start + 1; printf("mknew: %d\n", id); } ~q1() { printf("rm: %d\n", id); } int something(int n) { printf("La-de-da:%d\n", id); return n*(id+3);} }; void foo(void) { q1 one(1); one.something(4); … | |
I keep getting this error for the Pet read function: no match for 'operator>>' in 'fin >> ((Pet*)this)->Pet::age' whenever trying to compile the class. I have not implemented anything into main, but I am trying to figure out how to fix this problem so I can go on. Any help … | |
Hye........ plzzz solve my problem my problem is that in this progamme is runing but i dont understand that how in the end of the programme there is some thinds are missing that are when programme finished then it print the Thanks for using the program. and this progamme is … | |
Firs of all hello guys.And then straight to the point :) Ok so my trouble is with creating a password function that will display '*' instead of normal chars.So here is my code: [code=language] string EnterPass() { string Pass=""; char ch=getch(); while (ch != '\r') { if(ch=='\b') cout<<'\b'<<' '<<'\b'; else … | |
![]() | Hello guys, I'm new here and hoping to get some kind of help with my code. This code is to calculate sales tax for specific store. I've got the most part of the code working, but I have to modify it so that it continues to loop until the user … |
Hey there. I am taking a programming class using C++ and my assignment is to create "Tictactoe" using ObjectOrientedProgramming... The problem is I have no idea what I am doing... I need to have a "tictactoe" class file and a "player" class file - each with their own header files … | |
So in C++, using Something like Unix Sockets or Winsock with C++ lets you use things like TCP/IP. But it only lets you connect to an IP within your router when its by itself. How can I have the program somehow forward the connection to like an HTTP server or … | |
Hi, I am sure this question must have been asked before but I can't find it anyway. I have initialised an array of strings [CODE]char names[][90][/CODE] I don't understand why [CODE]char names[2] = "Bert" [/CODE] doesn't work (incompatible assignment error), even so I have tried [code] dir[2][90] = "Bert" and … | |
Please, any one help me to write a c++ program which display its source code??? | |
Hello, I'm new to Mac development, and for my first project stuck with Objective C only. In the interest of creating portable code, I'm now building non-GUI elements as C++ classes, which has gone alright but now I'm trying to compile a large, existing C++ library (STK audio kit) and … | |
Okay, so I am having a few problems with my computer science lab. Below is what I have so far. I am almost positive that the equations are correct, but for some reason I keep getting a different answer than the cs labs example program. So obviously something is wrong. … | |
Hi, Is there a way to stop the user from rezising to window ; so the user won't be able to make the window any bigger or smaller just the size i give to the window. I tried looking it up on this forum and MSDN , but MSDN is … | |
I'm having difficulty working with C++'s strings. I'm writing a program to solve a set of linear equations. I'd like to save the solution for various values of N (the size of the system is N X N), and n, a parameter within the system, to a text file, for … | |
Hi, I am getting an error when running a code on linux machine: "terminate called after throwing an instance of 'std::bad_alloc' what(): St9bad_alloc Aborted" In my code i have a 2 dimensional vector defined. Can someone tell me the possible cause of error. Thanks | |
can anyone help me write the code for the below situation using c-string? i'm cracking my head wif tis..... write a program that searches for a TV channel. A user may enter any of the following strings: TV1, TV2, TV4 or TV5. It does not matter if a user search … | |
Hi I get the common Undefined References error in CodeBlocks I am pretty sure The code is right. [code=c++] case WM_PAINT: { BITMAP bm; PAINTSTRUCT ps; HDC hdc = BeginPaint(hwnd, &ps); HDC hdcMem = CreateCompatibleDC(hdc); HBITMAP hbmOld = (HBITMAP)SelectObject(hdcMem, g_hbmAnime); GetObject(g_hbmAnime, sizeof(bm), &bm); BitBlt(hdc, 150, 100, bm.bmWidth, bm.bmHeight, hdcMem, 0, … | |
Hi, everyone! If you have worked on ACE, this is the post for you. I want to ensure that all the buffer contents of a file are on disk. So I want to use a fsync() or a fflush() function. I'm working with ACE_HANDLEs. Unfortunately, my searches concluded with this: … | |
I'm working on another piece of code that did the same thing as my Dom implementation only with Microsoft's System.Xml Here's the idea, I want to take an element and insert some text into it. <nameytag> *insert text here* </slashnameytag> Currently, I have this: [ICODE]#using <mscorlib.dll> #using <System.Xml.dll> using namespace … | |
Hello all, Before anything else, this issue is also posted at: [url]http://www.cplusplus.com/forum/general/7518/[/url] I have a structure similar to the one below.I miss a lot of information about the specific template parameters, so I would need something like what is in the code. This code does not compile because we cannot … | |
Hi, I've written a program for statistic analysis that can be found here [url]http://staff.pubhealth.ku.dk/~ande/web/software/relate.html[/url] I want to make it portable and the program works on unix with the following compilers sun, intel and gcc It also compiles on windows with mingw and the intel compiler. I've installed ms studio, but … | |
I'm sorry, I didn't realize I couldn't upload the exe file - but I have it ready to email. I'm having a big problem understanding how to complete this assignment and would really appreciate someone's help in getting me started. Basically, we are taking baby names from a file and … | |
ok i have to make a program that asks the user to enter how many kid are in their class, the ask the score for each kid, then display how many are passing. (70/100 is passing). im not sure how to make it count how many times the number 70+ … | |
Hi got something magical. node3 ( a variable) seems to point itself when i have not mad it so. Please help me understand this behavior. It seem to me like magic. And do provide with if any suggestion to correct the problem. [CODE] #include<iostream> #include<vector> #include<algorithm> #include<string> #include<fstream> using namespace … | |
I need help writing a simple program. My Declaration is: length, width, area and perimeter. My Input is length and width. The Calculations are: p=2*(l+w) and a=l*w and my[B] Output is p and a can anyone please help me write this program. I just started out doing this and I … | |
I think I'm on the right track, basically trying to count the number of tokens but it keeps telling me cannot convert to a const. [CODE] //This program is made to count the number of words. #include <iostream> using namespace std; #include <cstring> int wordCount(char *); int main() { char … | |
I am in the process of writing a project and I cant seem to get cout to work at all. I can however print to a file and use cin, and i have included all the necessary io. whenever i compile the program i have a line cout << "hi"; … | |
I have a person class which writes a name and age to file using binary I/O. By default I need it to create 10 slots for 10 people each set to "null" for name and 0 for age. Then it asks if you want to modify a record and if … | |
The folllowing code has me boggled. Here is a sample of code where you can see that the constructor for the FeetInches class is setting the numbers equal to the private variables inside... [CODE] int main() { // Define a LinkedList object. LinkedList<FeetInches> list; // Define some FeetInches objects. FeetInches … | |
So when two objects are declared say class shoe shoe1 and class shoe shoe_copy and then shoe1's variables are set, if the line of code: shoe_copy=shoe1; what would that be doing? After all what is the real data structure of the objects of class shoe? | |
Hi, I am new to C++ and I'm sure that this is an easy problem to someone who knows C++. I am trying to pass text from a textbox to another textbox on a different form. I would really appreciate any feedback on my code. [B][U]Form 6 Code[/U][/B] [Code] private: … | |
Hi, I could use some help. Our class assignment is to create a mortgage calculator in C++. The calcuation was provided all we had to do was code it. This is the fourth week of class and the assignment is from Ch. 2. I am sure it is not supposed … | |
hello there, i just want to ask...how would i apply threading to a web server app?? my problem is, i dunno how to create a web server...i created a simple server that sends hello world to a client that sends a request...how would i apply threading to this one?? | |
Hey men is it possible to build your own operator with your own definition and your own symbol for every type? | |
Hi, I'm having problems checking whether a string is an unsigned integer. The code I am using only checks the first character of the string, so "a1" would return false, but "1a" would return true. Any ideas where I'm going wrong? [code] bool checkUnsignedInt(string *str) { unsigned long value; stringstream … | |
Hi I'm working on implementing a neural network, but I'm having trouble calculating the error gradient. The problem is I don't know much about calculus and can't understand what exactly to do. I found this Web page that explains it quite well, but I still just can't get it. [url]http://www.willamette.edu/~gorr/classes/cs449/linear2.html[/url] … | |
If an explicit copy constructor is defined that makes a complex copy, does: [code=C++] int main() { class shoe shoe1; class shoe shoe_copy(shoe1); } [/code] And [code=C++] int main() { class shoe shoe1; class shoe shoe_copy; shoe_copy=shoe1; } [/code] Basically I'm asking if the assignment operator accesses the complex copy … | |
I'm fairly new to using C++, but I'd like to make a game like Krypto. To start off, I just need to learn how to make int a - f be a random number between 1 and 100. [code=cplusplus] #include <iostream> #include <string> using namespace std; int main () { … | |
Im new to C. is there a way to accept multiple inputs and store them in arrays? lets say 5 inputs and i need to store each of these in an array, is there a way that all 5 can be done at the same time? | |
Hello, i wan to do c++ program in ubuntu that able to write a summary on the directory example is drwx-x John 4096 d-w--x John 14 lrwx-x John 2300 How to i use array to put per column into array then access them so i can generate a report so … |
The End.