49,766 Topics
![]() | |
Hi, I have this struct: [CODE]typedef struct empresa { char nome_empresa [20]; MORADA morada_empresa; int nif; int telefone; int anocriacao; char cae [20]; ESTAGIARIO estagiarios [MAX_EST]; int num_est; } EMPRESA;[/CODE] And an array of this struct: [CODE]EMPRESA empresas [MAX_EMP];[/CODE] My problem is that when i try to, manually assign values … | |
Is it possible to print the .00 in the Part_Price[] so it would say 11.00 instead of 11. [CODE]#include <cstdio> #include <cstdlib> #include <iostream> using namespace std; double Part_Code[10]={1,2,3,4,5,6,7,8,9,10}; double Part_Number[10]={101,202,303,404,505,606,707,808,909,1010}; double Part_Price[10]={5.00,4.00,6.00,8.00,10.00,11.00,15.00,20.00,3.50,12.50,}; double Number_OnHand[10]={20,15,10,50,13,5,9,7,15,6}; int main(int nNumberofArgs, char* pszArgs[]) { int Pnumb,i; cout << "Enter Part Code '1' thru … | |
I've searched all over for an answer to this, including this forum, so sorry if I missed something, anyway, I'd like to get a numerical code from extended characters like ß or ü and so on. I don't use them very much myself, as I'm a native English language user! … | |
The first day of class today we had an (optional) diagnostic programming assignment. The problem is: to take an input file with a sentence in it, and make all letters except the first one lowercase, make the first letter uppercase, and remove any extra spaces and line breaks. After working … | |
hello, i have a dev c++ compiler and i want to install the allegro on it...... i tried few methods but they didnt work out.... can anyone tell me how to do it,plz? | |
Hello everyone, I am having a slight problem with my program, and that is that It just doesn't seem to be working! I would like someone to help me fix it, because I can't do It myself. The main problem I am having is adding a string to a string, … | |
Hello all, header files seemed pretty simple when i first learned about them. until i actually tried to use my own. The program that i am attempting to create should simply add 1 to 24, but it is using a function found in a header file as a test. The … | |
Hello guys. I want to create similar web browser in my application like VB6's web browser control (schw**.dll i think not sure). I just want it able to hold JavaScript, edit HTML elements, view page source, submit forms, ... like I already mentioned VB6 web browser component has... Cheers | |
Hello, I am writing a c++ program for windows using the API. My program needs to be able to get some text from the clipboard, import it to the program's scope as a string, and do work on the string. [what I have tried] [code] cout << GetClipboardData(CF_TEXT) << endl; … | |
Hello I have problem with adding two numbers that are less than 10 and their result is more than 10. [CODE]#include <iostream> #include <sstream> #include <string> using namespace std; typedef class node * node_pointer; class node { public: int num; node *nxt; }; string reverse (string str) { int len … | |
Hey, I have a bit of a problem. I have a class that uses C libraries to make a TCP connection, which is accomplished with the connect() function. Now, I'd like to use this class in a Qt program and make it inherit QObject. The problem is, since I need … | |
Hi everybody I wrote this code in my university assignment . But I want to change the global variable (the variables that above the main) to local variable (inside the main) and add the parameters in the functions. [CODE] #include <iostream> #include <string> #include <iomanip> using namespace std; int const … | |
If a user inputs a int number, say 150, how would I be able to read each individual number? i.e., I want to read the 1, do some things with it, then read the 5, and the next number...etc. Thanks | |
If I want to throw an instance of a class, where should I alloc the exception object? Should I use heap: try{ throw new Exception("An error was found"); } catch(Exception* e){ std::cout << e->get_message() << "\n"; delete except; } or should not use heap: try{ throw Exception("An error was found"); … | |
Need to read 4 bytes into a long int format. Both inFileDrs and outFileDrs are in ios::binary form. Is this the correct way to do this? The original piece of code was [CODE]var tableCount = reader.ReadUInt32(); writer.Write(tableCount);[/CODE] [CODE] unsigned long int tableCount, firstFilePos; inFileDrs >> tableCount; outFileDrs << tableCount;[/CODE] | |
The code below is what I'm having problems with... The combobox part is getting me angry and i've searched everywhere, code guru, msdn, stackoverflow, daniweb... And I cant figure it out. Its for a game my friend plays. I play and quit on and off.. I decided to do a … | |
Ok I am working on this program, I input the information it is supposed to pass it to the structures and then display, but its not there to display, and I know the information can't be missing since the math for the total which is done before displaying is done … | |
I am trying to finish up a personal project of mine, but am running into an aesthetic problem. I can't get the window to recognize the hIconSm when I try to set it. [CODE] WNDCLASSEX wnd; ZeroMemory(&wnd,sizeof(wnd)); wnd.cbSize = sizeof(WNDCLASSEX); wnd.hInstance = hInstance; wnd.lpfnWndProc = (WNDPROC) WindowProc; wnd.hCursor = LoadCursor(NULL,IDC_ARROW); … | |
So I have a few pieces of code that I want to implement into C++, and I think I understand what they are, but I want to check. I have been using an array of char[] to mimic the byte[] idea. So keep that in mind when helping with these … | |
Hi! I have a problem with SDL and OpenGL. I wrote a code to convert SDL Surfaces to OpenGL textures. Now I have a function to Draw a rect(with opengl) on a SDL_Surface. That's the code to draw a rect: [CODE] void DrawRect(SDL_Rect *rect, GLuint texture) { float x = … | |
i understand when you use memory on the heap, your program allocates new memory to it to be used...the stack is preallocated memory and when u put a local variable on the stack, and the variables goes out of scope/dies, it technically still stays in memory until you overwrite the … | |
Hi, Does anyone have (or know of) VS c++ which performs capture image using Hidden Markov Model, regards, | |
Well I'm learning the irc protocol by coding a Console client. The client appears to connect to server, set name and nick, But won't join the channel it just says "451 you have not registered". Here's the code Sorry for any lame formatting ect. I'm kinda new to cpp: [CODE] … | |
Hello, im currently making a save function for my Project wich is like this : [CODE] private: System::Void Form1_FormClosing(System::Object^ sender, System::Windows::Forms::FormClosingEventArgs^ e) { String^Sleeptime = textBox4->Text; StreamWriter^ sWriter = gcnew StreamWriter("c:\\DoNotEdit !.txt"); sWriter->WriteLine(Sleeptime); sWriter->Flush(); sWriter->Close(); }[/CODE] And this for the load function: [CODE]private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) { if … | |
I'm trying to make a Windows application but I get the error in the title. I am running Windows XP Professional and using VC++ 2008. Here is how I call my code: [code=c++] WNDCLASSEX wcex; wcex.cbSize = sizeof(WNDCLASSEX); wcex.style = 0; wcex.lpfnWndProc = WndProc; wcex.cbClsExtra = 0; wcex.cbWndExtra = 0; … | |
alright, I have most of this hammered out, but still a couple problems I cant figure out. in the player class, the Nextmove function is not working for me. It uses the setvalue function in TicTacToe class(which works fine by itsself) also there are problems assigning player names that I … | |
hi!! i have written this program and it worked, but the problem is ,when it runs it requires username and password. i've no idea about that. plzzz help,i wants to submit immediately.thanks. the code is given below: | |
Hello, This is my first post. I am trying to teach myself C++ and am having a hard time with a function problem. This is not for homework, I simply want to learn something about C++ and I have no one else to ask. The problem I am having is … | |
Hi, I use nested arrays of STL objects to generate a large number of objects (shapes representing projections of anatomical structures). I need to filter these into a tractable number based on certain properties that the objects possess: e.g. their geometric relationship to other objects and their functions (pair(int),order(int),left(bool)) A … | |
Hi all A teacher of mine told me that when an object of a class is created then six things are created.He didn't told me which.I know the obvious 4 things 1)Copy constructor 2)Copy asignment 3)Constructor 4)Deconstructor I don't know anything else?Do you have ab\ny idea?I searched everywhere but i … |
The End.