49,761 Topics

Member Avatar for
Member Avatar for easterbunny

Hi i got a problem with this code( attached below ) the fuction that receves the bidimensional array doesn't seem to work.I've tryed to cout in main() and it works.WHY???? The program doesn't show me any error whatsoever. #include<iostream> #include<string> #include<fstream> using namespace std; void afisare(int h[3][3],int nrEle){ for(int i …

Member Avatar for easterbunny
0
862
Member Avatar for cresenia1988

I'm currently doing an assignment and I would like to seek for help. I'm suppose to do a creation system where Option1: I would create a binary file(outfile.dat) from infile.txt. //below is the infile.txt F Indonesian Michael Chen F France Alain Pierre S Tan Eng Soon S Lee Ang Heng …

Member Avatar for mrnutty
0
193
Member Avatar for glen999

please help i'm stuck on something for a project i'm doing i need to display the numbers 1 to 9 randomly but they cannot be repeated! the code i have so far is this: #include <iostream> #include <ctime> #include <cstdlib> using namespace std; int main() { srand((unsigned)time(0)); int random_integer; int …

Member Avatar for deceptikon
0
157
Member Avatar for K33p3r

Good day, I have a college project in which I need to create a program which simulates an Erlang(k) variable. I am not talking about the Erlang language, it's about a standard Gamma(0,1,k), k ϵ N+. I appreciate if someone can help me out or give me advice on how …

Member Avatar for m4ster_r0shi
0
354
Member Avatar for jinglylime

Hi,I have encountered a problem while doing the animation for my program. I wanted keep adding a another shape on top of another. But for evry second image the background changes to black. Can you point out what I've done wrong. Thanks. #include <stdlib.h> #include <stdio.h> #include <time.h> #include <GL/glut.h> …

Member Avatar for emilo35
0
237
Member Avatar for annitaz

#include <QApplication> #include <QLabel> #include <QVBoxLayout> #include <QTextEdit> #include <QWidget> int main (int argc, char* argv[]) { QApplication app (argc, argv); QWidget window; QLabel* label = new QLabel("Please enter some text"); QTextEdit* textEdit = new QTextEdit; QVBoxLayout* layout = new QVBoxLayout; layout->addwidget(label); layout->addwidget(textEdit); window.setLayout(layout); window.show; return app.exec(); } 1.Qt provides …

0
117
Member Avatar for Sudha Granger

void doc::add_title() { doc d; fstream f; int med_lic,flag=0; char new_title[20]; cout<<"\n\t\t\tADD NEW DOCTOR TITLE\n"; cout<<"\nEnter the Doctor's medical license number :\t"; cin>>med_lic; f.open("doctors.da t", ios::binary|ios::in|ios::out); while(f.read((char*)&d,sizeof(doc))&&flag==0) { if(d.ret_med_no()==med_lic) //d is an object of class doc { cout<<"\nEnter the new title:\t";//ret_med_no() is an accessor function used to return a value …

Member Avatar for Sudha Granger
0
281
Member Avatar for hay123

This is my code so far: #include <iostream> #include <cmath> #include <cstdlib> using namespace std; int main() { float numbers[15]; float sum, lowest, highest; float min, max, range, stDev, mean, median; int indexOfMin; float above = 0, below = 0; sum = 0; for(int testNum = 0; testNum < 15; …

Member Avatar for histrungalot
0
252
Member Avatar for usustarr

Hi, First of all, i am not trying to hack into anything or anyones e mails. I am new software engineer and I need to log into company wiki page & download info displayed into a text file or something, so i can search for data i am looking for …

Member Avatar for rubberman
0
168
Member Avatar for triumphost

I have a button created as follows: ~~~ HWND License; HBITMAP MainButtons; Case WM_CREATE: License = CreateWindowEx(WS_EX_TRANSPARENT, L"Button", L"License", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP | BS_BITMAP, 26, 77, 75, 23, hwnd, (HMENU)ID_LICENSE, hInst, 0); MainButtons = (HBITMAP)LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_MAINBUTTONS), IMAGE_BITMAP, 0, 0, LR_SHARED); SendMessage(License, BM_SETIMAGE, IMAGE_BITMAP, (LPARAM)MainButtons); break; ~~~ …

0
73
Member Avatar for phorce

Hello, I'm having trouble with something.. I have a vector of doubles and I need to convert the vector to an unsigned char so then I can write the contents to a text file. I can do this when reading the data from a text file, just not from a …

Member Avatar for m4ster_r0shi
0
135
Member Avatar for Rasool Ahmed

Hi gueys, I am programming a class compenent liberary in C++ CLR, but I have a problem with exception throwing. this is the code that call the exception: `throw gcnew ReadStreamException(Error);` and this is the exception class: public ref class ReadStreamException : Exception { ReadStreamException(String^ Message) : Exception(Message) {} }; …

0
114
Member Avatar for jwill222

I meant to post this in the C forum and not the C++ forum. Below is the link to a picture of the debug error window [url]http://www.flickr.com/photos/7629837...in/photostream[/url] It's a program that i'm doing and I keep getting this error here's a link to the programming problem. Its' Number 3 [url]http://books.google.com/books?id=bSy...%2B%2B&f=false[/url] …

Member Avatar for jwill222
0
268
Member Avatar for _Nemesis_

Hi guys, I have been trying to implement the A* algorithm in C++ and would like to make use of the priority_queue structure to hold the open and closed lists of nodes. The problem is, all of the algorithms that I have found use the equivalent of a "search/contains" function …

Member Avatar for _Nemesis_
0
1K
Member Avatar for Labdabeta

I have an array of data of the form: union colour { unsigned int argb; struct{ unsigned char a; unsigned char r; unsigned char g; unsigned char b; }bigendian; struct{ unsigned char b; unsigned char g; unsigned char r; unsigned char a; }littleendian; }; struct sprite { int w,h;//stores the …

Member Avatar for Labdabeta
0
682
Member Avatar for f4fjks

hi guys! today i tried file writing through VC++ 2010. suddenly a point stroke in my mind to create a file which may not be read by notepad or it gives error or some wrong output as it is mostly seen on opening a pdf file in notepad. for this …

Member Avatar for NathanOliver
0
247
Member Avatar for triumphost

I'm trying to clip my Button with the following code but it does not work at all.. #pragma comment(linker,"\"/manifestdependency:type='win32' \ name='Microsoft.Windows.Common-Controls' version='6.0.0.0' \ processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"") #pragma comment(lib, "Gdiplus.lib") void RegionCloseButton(HWND hwnd) { CloseRegion = GetDC(hwnd); CloseRegionMem = CreateCompatibleDC(CloseRegion); Gdiplus::Graphics graphics(CloseRegion); Gdiplus::FontFamily fontFamily(L"Courier New"); Gdiplus::GraphicsPath path; Gdiplus::PointF Origin(5, 5); path.AddString(L"X", …

0
185
Member Avatar for ChevyScience

Hey all i am trying to write a Min Heap program using that allows insertion and deletion. I have the code for what i believe is insertion, but i am having trouble trying to figure out code to heapify and remove from the heap. If possible could anyone lend me …

0
62
Member Avatar for orar

#include <iostream> #include<string> using namespace std; struct people { string fname; string lname; void input() { cin>>people.fname>>people.lname; } void output() { cout<<people.fname<<people.lname; } }; struct birthday{ int day; int month; int year; void output() { cout<<day<<birthday.month<<birthday.year; } void input() { cin>>day>>month>>year; } }; int i; int main() { cout<<"Birthday Program"<<endl; …

Member Avatar for orar
0
371
Member Avatar for triumphost

Hey all, I've been searching Rohitab, CodeProject and various other sites to figure out how to write OPCodes to a file and cannot figure it out. I thought I'd ask here because it's the only site I have an account on and I usually get my answers here or hints. …

Member Avatar for mike_2000_17
0
305
Member Avatar for triumphost

Does C++ Console apps have a TryParse equivalent.. I mean .Net has it for both C# and C++ but why does C++ Consoles NOT have this! Or am I just wrong and cannot find it? I was thinking of writing my own with templates that can be use for ANY …

Member Avatar for m4ster_r0shi
0
2K
Member Avatar for flynwltn

Write pseudocode and has the following; 1. It should write the guess secret number to standard output 2. It should ask yhe user if the secret number is higher, lower or if you guessed correctly 3. It should read the answer. Repeat the question if it is not one of …

Member Avatar for TrustyTony
-1
74
Member Avatar for Rasool Ahmed

Hi gueys, I have question searched in google but without something that can help. **How to get the binary stream from files ( especially executable files) using winapi (CreateFile , etc)????** I learned in these days how to read write files using Createfile, ReadFile, WriteFile , etc and all these …

Member Avatar for Nick Evan
0
2K
Member Avatar for isaacjun16

Hi, I have a problem with a the imput of some data on a program Im making (FYI new in c++, homework). So basicly the progrma I have is to imput diferent type of data, this is what im doing. (Im using codeblock 8.02 in Ubuntu 10.04 ) #include <iostream> …

Member Avatar for isaacjun16
0
267
Member Avatar for 9tontruck

Hi guys, I am programming in C++ with NetBeans. It works fine when I playing with just one main.cpp file. But After I added an additianal class (1 .cpp and 1 .h), it makes an error even though I do not make any changes in the new files. (all I …

Member Avatar for FelineHazard
0
144
Member Avatar for fishsticks1907

I'm not sure what i'm doing wrong, any help would be great. main.cpp(58): error C3861: 'preOrederHelper': identifier not found main.cpp(53) : while compiling class template member function 'void tree<T>::preOrderHelper(treeNode<T> *) const' with [ T=int ] main.cpp(9) : while compiling class template member function 'tree<T>::tree(void)' with [ T=int ] main.cpp(103) : …

Member Avatar for fishsticks1907
0
841
Member Avatar for freedomflyer

I am trying to run chekstyle on all of my files within a project. So I have model, view, and controller folders all with their subfolders of .h and .cpp files. Is there any way to grab all the files that end in .h or .cpp without having to individually …

Member Avatar for chris.stout
0
180
Member Avatar for Labdabeta

I am using code::blocks and have written a dll. I am currently testing it but am getting tired of having to compile it, copy the DLL, DEF, H and A files into a test project, and then compiling the test project every time I need to fix something. Is there …

Member Avatar for Labdabeta
0
242
Member Avatar for nuclear

I was just wondering why do we exactly call glTranste command if its possible just to increase objects x, y or z. And its even stated in this tutorial: http://nehe.gamedev.net/tutorial/particle_engine_using_triangle_strips/21001/ that its even faster to only use Vertex3f() instead of resetting the Modelview Matrix. Anyways, maybe its just something particular …

Member Avatar for nuclear
0
259
Member Avatar for T0pAz

This code: DomainThingy^ thingy = (DomainThingy^)_scriptDomain->CreateInstanceAndUnwrap(Assembly::GetExecutingAssembly()->FullName, DomainThingy::typeid->FullName); Produces this error: System.InvalidCastException was unhandled Message: Unable to cast transparent proxy to type 'Hook.DomainThingy'. Does anyone knows how to fix it?

Member Avatar for T0pAz
0
278

The End.