51,593 Topics
![]() | |
This is not a homework problem & my first post in 2+ years. I just got asked to do this in C# based on my asp & DB experience & I am tearing my hair out as they want in done in one day & 2 MS videos say to … | |
Hi to all, i have a little problem with my little application. I create a graphic object where i draw a series of text. I create it with [CODE=C++]Graphics gg(hdc)[/CODE] where hdc in the handle context of the screen ( BeginPaint ). Now i want to save this graphics object … | |
1.write a program that asks the user to type 10 integers and writes the sum of these integers.Using [B]for[/B] loop.Can anybody help me with this question?? | |
Here is my whole problem can someone please please HELP Please 1. SPLIT THE PROGRAM IN 3 FILE NETWORK. H, NETWORK.CPP. CLIENTNET.CPP AS IN ADT. DONE 2. DEFINE A CLASS CALLED ADDRESS_T (done) with member for the four integers of an internet address and a fifth member in which to … | |
[CODE]#include <iostream> #include <cmath> using namespace std; int n; void main(){ cout<<"input the number of students: "; cin>>n; double *scores= new double[n]; cout<<"enter the scores of the students: "; for( int i=0; i<n; i++){ cin>>scores[i]; } double sigma,sigma2, mean, strDev; int ii; for (sigma=ii=0;ii<n;ii++){ sigma+=*scores; *scores++; mean= sigma / n; … | |
I play this game called GunBound, and have a nice C++ script for it. But I need a function that can help me do the following: [CODE]int x=390; int y=450; for(int i = 0; i == 0; x++) { if(scanpixel(x, y) == YellowColor) i++; }[/CODE] I need to get the … | |
Can anyone help with using c++ derived types in fortran? I got a pdf but it was of no use. | |
The file "airports.csv" contains [U]12 pieces [/U]of info per line - separated by commas: [B]BIN,"Bamiyan","Bamiyan","Afghanistan","AF",34.800000,67.816667,701,"Afghanistan",\N,\N,1149361[/B] (there are 3 such lines for now) How do I modify my program to take the 1st, 3rd, 5th,6th,7th pieces of info per line and store them in an array- ill later use that array … | |
Hi: I never set up a 2D array in the past and I am trying to do it now. I have a program that reads a 1 line text file and after reading it makes some calculations. After this I made some changes to my code trying to make a … | |
in want to edit the code in such a way tht the user can enter upto 10 values maximum..need help pls ... [CODE] #include <iostream> #include <iomanip> using namespace std; struct node { int info; struct node* next; }*front,*rear; void enqueue(int elt); int dequeue(); void display(); void main() { int … | |
I am new to c++ and I'm kinda struggling. I'm trying to write a program to guess a number that the user inputs. The program should guess a number then the user should be prompted if it is too high or too low. then the program should guess again, intill … | |
Hi there, i am trying to implement thread injection from my windows forms .NET project. Here is the code which works just fine from simple console app or Gtk+ gui application, but unfortunately not from .NET gui app. [CODE]#define NtCurrentThread() ((HANDLE) -2) #define NtCurrentProcess() ((HANDLE) -1) typedef DWORD (WINAPI *Rm_MessageBoxA)(HWND … | |
I am using multiple threads that are doing work. I need the threads to update an integer once they finish processing. [CODE] //Lock i_Flag++; //Unlock [/CODE] Then [CODE] if(i_Flag == i_ThreadCount) //Do something. [/CODE] My question is whether I need to use locks around i_Flag++ because it is a simple … | |
Hello, I'm trying to do something like this: - There're Base class and Derived classes. - Some Derived classes use multiple inheritance, from Base class and a pure virtual class called Interface. These classes are able of some functionality that ordinary Derived classes aren't. Why doesn't it work to cast … | |
Hi, I've got construction of namespaces like this: namespace one { namespace two { class SomeClass{...}; } } and when I try to use this class (without fully qualified name) in another file (also with nested namespaces) I'm getting errors. It doesn't even help if I place declaration of using … | |
![]() | Hello, I'd like to make some application which will play videos or flash animations over the desktop. The only idea I have is to use DirectShow, make application window transparent and "always on top". But this is not exactly what I want. I'd like to have something playing on the … |
I thought i had complex declarations nailed, as in i could tell you what a pointer to an array of functions that returned int and took doubles as arguments looked like i find this little horror: [CODE] /Return the IP address of a domain name DECLARE_STDCALL_P(struct hostent *) gethostbyname(const char*); … | |
when i use random my settextstyle starts malfunctioning eg if i choose Gothic style i gives plain text if i make randomize a comment it works without bugs can anyone help me and also i heard void main is wrong and int main is correct why?? | |
Guys...I badly need your help...I made a Hangman game and the requirement is it mus be a two player game so I need to make use of socket programming. The problem is I don't know what to do next..I do not know how to do the read and write the … | |
Hi, I am using Borland c++ builder 2009 and I want to make a graphical application for my project. I need a book that can teach me that. I searched the net but I always found book on version 5 which is over 10 years old. Does anyone know any … | |
Hi, first of all I would like to thank you for taking the time to look at my problem. I'm trying to input to a multidimensional character array. The error occurs on the second array. I tried to understand the problem by varying my input, but it always occurs on … | |
This is my problem...hopefully somebody can help me out with this. This is what I am supposed to be doing: Recursive Binary Search of 2-dimensional array: Load a 30x20 two-dimensional array of ints with values from the file “values.txt”. The file contains 900 numbers in order. Once the array is … | |
so... i have been looking at this for a good 20 minutes and it makes no sense. when i compile this simple linked list implementation, it gves me this compile error. obj\Debug\Projects\LinkedList\LinkedList.o||In function `_ZN4nodeC1Ev':| obj\Debug\Projects\LinkedList\node.o:C:\Program Files (x86)\CodeBlocks\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\include\c++\3.4.5\bits\locale_facets.tcc|2497|first defined here| ||=== Build finished: 1 errors, 0 warnings ===| any ideas what … | |
I'm pretty new to opengl but been using c++ for a while now. How can I display variables using this? I can display single characters by using [code] glutStrokeCharacter(GLUT_STROKE_MONO_ROMAN,'0'); [/code] Why can I not use [code] int x = 0; glutStrokeCharacter(GLUT_STROKE_MONO_ROMAN,x); [/code] Compiles but won't display anything. | |
hi all. I'm not sure if its possible but can you call a different constructor inside a constructor of a object? ie can i have different constructors call a single constructor to set up the object [code=c++] class foo { public: foo(int) foo(double) //... }; foo::foo(int number) { this = … | |
is there a way to get the pixel color that is under the mouse? i heard of ways where i can turn it into bmp's a.. but even then i can't get the color of the pixel under mouse.. D: i just need a thing to make it get the … | |
Access violation (Segmentation fault) raised in your program. I received this error when I ran my program after compiling it. I can't find the error in my code. main.cpp [CODE=c]/* Main.cpp source file. Main module. Copyright 2009 (GNU CC Licence) Madcow Deity Productions */ #include <cstdlib> #include <iostream> #include "System.hpp" … | |
Hi, I have two seperate programs below writing a short program for each. My programs run, but sometimes when I rearrange things in my program to try to get it to work, I will receive an error. I am tried to figure it out since last night, but I am … | |
I can't reverse the inputted word... Here is my code... Please correct it... Sample Output: Type word(s): hello The reverse is: 'olleh' [CODE=c]#include <stdio.h> #include <conio.h> #include <iostream.h> #include <ctype.h> #include <stdlib.h> #include <string.h> char orig [300]; char rev [300]; int len; void original () { cout << "\n\n\tType word(s): … | |
Hello all, I have a question on using ArrayList class. Basically, I have a class called Customer as follows: class Customer { int ident; float value; float newValue; public: void setIdent( int ); int getIdent() const; void setValue( float ); float getValue() const; void setNewValue( float ); float getNewValue() const; … | |
I'm new to recursion and object oriented programming, but we have been assigned the knight's tour problem. This is where the knight's piece has to travel to every space on a chess board and land on each spot only once. I pretty much have my program done, except i'm having … | |
I am having problems with traversing a parce tree. I need to do an in order traversal recursively. Here's the class's private section... [CODE] template <class data> class BinaryTree { private: struct tNode { data info; tNode *left; tNode *right; }; tNode *root; public: }; [/CODE] I'll be calling inOrderTraversal() … | |
So heres the problem. My Grandmother needs to look up stocks, but she has trouble using "FoxFire" to look it up. I need a way where she can enter the name of the stock she wants, and the program enters it into a google search and searches for the stock. … | |
Bellow is the piece of code that causes Segmentation Fault: (in Linux Segmentation Fault is usually due to illegal memory access) else if(intData==3) { FILE *fp; int ch; if((fp = fopen("file.txt","rb"))==NULL) { printf("Cannot open Source file.\n"); exit(1); } while((ch = (int)fgetc( fp )) != EOF) { printf("%s",(char*)ch); send(client, (char*)ch, 1,0); … | |
Hey! Im new to this C++ stuff and the first major problem I run into is a two dimensional array. I have to declare the array and store data values from ANOTHER data file. I have some of the code written down. Please help and tell me what I'm doing … | |
Hello Everyone, I am presently working on VC++ project, i have to create a new airgauge component using activex, [COLOR="Green"][B][U]can you please let me know if there is any better tool for creating a activex component, and i would also like to know if there are any good books on … | |
Hi: I am trying to create a loop for a code. My loop is supposed to find all the combinations using the numbers 1 and 0 depending on the length of my string. For example if I set up my string to be 3 then the program should give me: … | |
Hi Can anyone help me in extracting all the tables and its contents that are present in a MS word document using c++ or C | |
this progran will simulate a process queue, giving time slices based on the priority. The process entries will be in a file, one per line.the data is the start time, priority level, total time to run and process name. when I run the program I got few problem 1. how … | |
Hi, I am trying to write a program that finds the minimun and maximum number in an input set of numbers. I am using a loop to update the set as the program reads the cin. Example code: [CODE]min = max = -1 cout << "Enter termination value that will … | |
Program needs to read the students' first name,last name and test scores.Suppose that class has 20 students.Use an array of 20 components of type studentType. Output : last name followed by comma,space first name , score, revelant grade, and find the highest test score, print names of the students having … | |
I want to write a Code in C which can create copy any given file (txt, bmp, jpg, pdf etc) what i've written so far is: int main(){ FILE *fp; char ch; FILE *fpW; if((fpW = fopen("file2.bmp","w"))==NULL) { printf("Cannot open Destination file.\n"); exit(1); } if((fp = fopen("file.bmp","r"))==NULL) { printf("Cannot open … | |
Hi all, How about this? In this example, what is the correct way to initialise Secret mission? [CODE]class Secret { private: int data; public: Secret(int _data) { data = _data; } }; class Mission { public: Secret mission; Mission(); { } };[/CODE] the only way i know of is using … | |
hello im writing a if statment for class and i cant get the program to terminate if the user goes to the else statement it still prints out the other cout's here is my program your supposed to enter in a id number then the crn of the class u … | |
Hi all, Maybe you can help me with this... in the code [CODE]float dot(const Vec3& v) const { return (x * v.x) + (y * v.y) + (z * v.z);}[/CODE] What is the purpose of the keyword const? Why in the case of [CODE]Vec3 operator=(const Vec3& v) const { x … | |
[CODE]ok ok i got it now right i copy it to vector and sort it..... here is the code #include <iostream> #include <fstream> #include <algorithm> #include <string> #include <map> #include <vector> using namespace std; typedef map<string,int> word_count_list; struct val_lessthan : binary_function < pair<string,int>, pair<string,int>, bool > { bool operator() (const … | |
there is fstream in normal C++ that allows you to do file i/o but how do i do this in managed C++ in a forms application? i read about a config file but i dont quite get it.. thnx. | |
Does anybody know of a good tutorial that could teach me how to use LINQ in C++, I will be using it to communicate my game to an online MySQL database and it will also be reading XML files. | |
Can some help me with a random between two choices ? Something like: L = random(A, B); and in L to have A or B. Thx. |
The End.