51,593 Topics

Member Avatar for
Member Avatar for Jayrrus

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

Member Avatar for ArkM
0
136
Member Avatar for pspwxp fan

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 …

Member Avatar for William Hemsworth
0
194
Member Avatar for kux

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

Member Avatar for ArkM
0
117
Member Avatar for gkarima

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 …

Member Avatar for nmaillet
0
154
Member Avatar for theighost

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 …

Member Avatar for theighost
0
84
Member Avatar for Marcel91

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

Member Avatar for kbshibukumar
0
104
Member Avatar for Mike Savino

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 …

Member Avatar for kbshibukumar
0
71
Member Avatar for ryan858

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 …

Member Avatar for ryan858
0
96
Member Avatar for claretm

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 …

Member Avatar for claretm
0
3K
Member Avatar for delerium12345

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 …

Member Avatar for subtercosm
0
930
Member Avatar for kiong

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 …

Member Avatar for kiong
0
238
Member Avatar for atman

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

Member Avatar for Lerner
0
126
Member Avatar for kotkata

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 …

Member Avatar for Lerner
0
103
Member Avatar for sidrah

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 …

Member Avatar for Mike Savino
0
160
Member Avatar for tedobg

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 …

Member Avatar for trapkat20
-1
161
Member Avatar for flip.phinoi

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 …

Member Avatar for WaltP
0
288
Member Avatar for redhotspike

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 …

Member Avatar for VernonDozier
0
3K
Member Avatar for amerninja2

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 …

Member Avatar for amerninja2
0
1K
Member Avatar for coveredinflies

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 …

Member Avatar for nmaillet
0
105
Member Avatar for bubun1979
Member Avatar for ArkM
0
200
Member Avatar for Jiropole

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 …

0
45
Member Avatar for jladd5

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

Member Avatar for StuXYZ
0
291
Member Avatar for h3llpunk

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 …

Member Avatar for h3llpunk
0
94
Member Avatar for driebel

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 …

Member Avatar for DemonGal711
0
197
Member Avatar for guest7

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

Member Avatar for guest7
0
82
Member Avatar for kiong

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 …

Member Avatar for Lerner
0
99
Member Avatar for h3llpunk

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

Member Avatar for h3llpunk
0
1K
Member Avatar for GDICommander

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

Member Avatar for GDICommander
0
224
Member Avatar for jake88

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 …

Member Avatar for jake88
0
140
Member Avatar for rmlopes

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 …

Member Avatar for rmlopes
0
151
Member Avatar for monkey_king

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 …

Member Avatar for Nick Evan
0
104
Member Avatar for delerium12345

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 …

Member Avatar for Ancient Dragon
0
510
Member Avatar for Happie Juice

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

Member Avatar for Nick Evan
0
100
Member Avatar for T.N.Sharma

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 …

Member Avatar for T.N.Sharma
0
139
Member Avatar for southernd0529

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 …

Member Avatar for Comatose
0
153
Member Avatar for Dontais

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 …

Member Avatar for Dontais
-1
85
Member Avatar for jrw0267

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

Member Avatar for jrw0267
0
62
Member Avatar for skitzo315

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 …

Member Avatar for Ancient Dragon
0
154
Member Avatar for rosenberg_a

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 …

Member Avatar for rosenberg_a
0
146
Member Avatar for CPPRULZ

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?

Member Avatar for MMahmoud
0
149
Member Avatar for liverbird

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

Member Avatar for cikara21
0
52
Member Avatar for alphabetanm

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 …

Member Avatar for alphabetanm
0
127
Member Avatar for jaepi

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

Member Avatar for smitz
0
124
Member Avatar for massivefermion

Hey men is it possible to build your own operator with your own definition and your own symbol for every type?

Member Avatar for ArkM
0
92
Member Avatar for jraven1

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 …

Member Avatar for ArkM
0
278
Member Avatar for bitRAKE

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

Member Avatar for bitRAKE
0
163
Member Avatar for CPPRULZ

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 …

Member Avatar for CPPRULZ
0
169
Member Avatar for Nick_Plante

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

Member Avatar for GDICommander
0
150
Member Avatar for justluck

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?

Member Avatar for Salem
0
69
Member Avatar for ohara

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 …

Member Avatar for ohara
0
112

The End.