49,761 Topics

Member Avatar for
Member Avatar for Alyboi

[code]#include "stdafx.h" #include <iostream> #include <string> using namespace std; int _tmain(int argc, _TCHAR* argv[]) { const int Grade1 = 0 ; 29; const int Grade2 = 30 ; 39; const int Grade3 = 40 ; 69; const int Grade4 = 70 ; 100; int Grade ; int i = 0 …

Member Avatar for Red Goose
-1
124
Member Avatar for kk33

Hi all , I am having problem about killing multiple treads in my program at the same time, here is my code: [CODE] int main() { while(1) { i++; HANDLE thread =(HANDLE)_beginthread(TheThread, 0, NULL); if(i==10) break; } Sleep(3000); TerminateThread(thread,0); return 0; } [/CODE] now "TerminateThread(thread,0);" will only terminate the 10th …

Member Avatar for Ancient Dragon
0
246
Member Avatar for ethanbuckley

Error 26 error C2061: syntax error : identifier 'Form1' c:\Users\Black Chocobo\Desktop\WaveMachine\managesongs\WaveMachine\WaveMachine\WaveMachine\WaveMachine.cpp 16 [CODE]// Create the main window and run it Application::Run(gcnew Form1.h());[/CODE]

Member Avatar for jonsca
0
118
Member Avatar for ethanbuckley

1>c:\users\black chocobo\desktop\wavemachine\managesongs\wavemachine\wavemachine\wavemachine\Form1.h(334) : error C3845: 'WaveMachine::Form1::filePath': only static data members can be initialized inside a ref class or value type [CODE] // the actual music file and its path is kept in the second subItem (of each track) String^ filePath = this->listView1->CheckedItems[0]->SubItems[2]->Text;[/CODE] Any suggestions

Member Avatar for jonsca
0
158
Member Avatar for saadahkh

Hi every body . iam writing a code that reads a line from input file and searches it in test file. but my getline() function reads only the first line and enters an infinite loop i have read many discussions on the topic but still unable to resolve the issue. …

Member Avatar for WaltP
0
513
Member Avatar for johans22

I use visual studio tool. This compiles but no real output. [CODE]#include <iostream> #include <windows.h> #include <cstdlib> struct somestruct { char *name; int number; }; void mythread(void *lpParam) { somestruct* p = static_cast<somestruct*>(lpParam); printf("%d\n",p->number); ExitThread(0); } int main() { DWORD thread; struct somestruct *p; p = (somestruct*)malloc(sizeof(struct somestruct)); p->name=(char*)malloc(strlen("First Last")+1); …

Member Avatar for daviddoria
0
85
Member Avatar for MasterGberry

Note, this is converted from C# with a converter program and some of my own hand coding, there is definitely a possibility that the compiler is right and something of the sort does not exist in C++, or its named diff. I am having an issue with the long !System::Windows....line, …

Member Avatar for MasterGberry
0
246
Member Avatar for alonewolf23

[CODE]#include <cstdio> #include <cstdlib> #include <iostream> using namespace std; int main(int nNumberofArgs, char* pszArgs[]) { char ch, play_or_no_play='y'; while (play_or_no_play == 'y') { cout << "Enter a character: "; cin >> ch; while (ch != 'c') { cout << "Wrong Character, try again: "; cin >> ch; } cout << …

Member Avatar for alonewolf23
0
149
Member Avatar for gth759k

I'm trying to add a way to create scenes for my raytracer without having to recompile it every time. So far i've gotten the irrXML parser up and working. My xml file declares all the scene properties I need and i can get them into my raytracer, but my problem …

Member Avatar for ravenous
0
240
Member Avatar for johans22

I am sort of new to forums, therefore forgive me for mistakes. I am trying to eliminate a for loop within a function and run the function in multiple threads. Is it possible?. The comment inside the code, explains it. Any reasonsble change that results in a good multi-threading. [CODE]#include …

Member Avatar for johans22
0
97
Member Avatar for rabihayass

I have to make a simple 3d game. The game scenario consists of a spacecraft that is attacking the home planet by firing rockets from along its length randomly. The game player moves the baton up and down to stop the rockets before they reach the planet. The star field …

Member Avatar for daviddoria
0
176
Member Avatar for sanjanac++

I'm using turbo c++ to build a project for school. It is compulsory to use TC++. I tried downloading windows.h but it gives a lot of errors when compiled. Is there any link i can use to do so easily without many problems? Tuesday is the deadline. Please help!

Member Avatar for ravenous
0
90
Member Avatar for Drakarus

I am making a program that involves adding time. It involves adding a beginning time, duration which would lead to the result of an end time from the sum of beginning time and duration. I will illustrate the problem i am having below: 12:15 start time with a duration of …

Member Avatar for nathanseye
0
98
Member Avatar for thelostboy

Hello all!! First of I just want to say that this is a great site. I am just looking for some advice I have just started studying for my degree in software development. I have been reading a lot of books on software development and they all say the wau …

Member Avatar for TSims11
0
158
Member Avatar for ethanbuckley

I have created a music player that is yet to function to its full ( the add button on my main form1 won't bring up the AddNewWaveTrack_form ). These errors vary so any help is much appreciated as I want to learn fast. [CODE]#pragma once #include "AddWaveTrack_form1.h" #include "EditWaveTrack_form1.h" namespace …

Member Avatar for TSims11
0
372
Member Avatar for tomtetlaw

I'm trying to use a DLL that is generated from one of my projects. When I try to compile I get alot of linker errors from ONE of the files from the DLL project. What I think is the problem is that I should be linking to the .lib file …

Member Avatar for tomtetlaw
0
170
Member Avatar for BChicago

Hi, I'm trying to add a drop down combo box for user selection in the main window of my application. The program reads USERS.txt, loads each line into a const char*[] and (hopefully) adds them to the combo box. The problem is my program displays Chinese characters instead of the …

Member Avatar for Ancient Dragon
0
529
Member Avatar for MasterGberry

Okay, so I understand this C# program I was given to analyze, and now I am being told that I need to convert the entire program into C++, just my luck. So there are several features that at the moment I do not understand how to convert over. If there …

Member Avatar for MasterGberry
0
253
Member Avatar for prgmwitch

Hello, I'm working on a program that requires an XY coordinate plan and I can't seem to find a source anywhere!! that shows how to print a "." or "+" or anything at a certain xy coordinate on the screen. for instance, I need to be able to take 2 …

Member Avatar for mrnutty
0
240
Member Avatar for jitender939

plz help me on this question..... 1 2 3 4 5 6 7 8 9 how i can swap this like this 3 2 1 6 5 4 9 8 7 plz soon.......

Member Avatar for Red Goose
0
120
Member Avatar for by_stander

Help.... I have 3 vectors I want to store in 1 array, but I can't figure out what I'm doing wrong [CODE] vector<double> range, az, el; double RAzEl[1000][3] = {}; for ( unsigned int j = range; j <= (num); j = j + ncols ) { range.push_back(row_d[j]); } for …

Member Avatar for by_stander
0
2K
Member Avatar for linova

Hi.. Could anyone help me to find out why this program cannot count the frequency of each alphabet? There is a output for calculating the total lines and length but not the frequency.Appreciate any help. Thanks! [CODE] int main() { const int MAXLENGTH=10; const int MAXCHARS=10000; static double i[26]; char …

Member Avatar for WaltP
0
156
Member Avatar for cute cat

[COLOR="Red"]can [/COLOR]you help me!! I have assignment that told me to write a function 'CheckSmaller' that takes two linked list as input arguments. These linked list contain numbers like this: num1->3->5->2->NULL (assuming that num1 is pointing to number 352) num2->4->3->9->1->NULL (assuming that num2 is pointing to number 4391) The function …

Member Avatar for Red Goose
0
201
Member Avatar for thelostboy

Hi all This is for anyone that saw my other post I am developing a reservation system for a restraunt as a means of gaining experience and improving my programming. What I was windering I was hoping to implement a process where one restraunt could take the reservation for any …

Member Avatar for Narue
0
115
Member Avatar for wrathmakin

Hey guys, I'm new to these forums and new to C++ in general. I have been looking around the forums and I have found threads with similar issues to mine but unfortunately they don't cover my exact issue. Essentially I want to make a histogram in C++ that takes a …

Member Avatar for wrathmakin
0
4K
Member Avatar for MasterGberry

So I made a program, and have thoroughly tested the bugs out, and now finally figured out how to make a release build for my grandfather to see. So he tries running it and it crashes on the first input. I was told i may need to send him the …

Member Avatar for MasterGberry
0
74
Member Avatar for jaglever

I need to read a file which looks like this: model=binomial steps=1 time horizon=1 S=101 u=1.2 d=0.95 r=0.03 number of instruments in portfolio=2 instrument=option exercise=european position=short type=put strike=98 expiry=1 instrument=option exercise=european position=long type=put strike=10 expiry=1 and i just need to read everything what is on the right site of '=' …

Member Avatar for VernonDozier
0
221
Member Avatar for nickoooname

Hi Guys, Im currently working on a school project but im stuck, if worked on this problem for over 4 days now and i cant fix it. Using Direct3D 9, Visual studio 2010, im trying to make create a heightmap. Im using a bmp file. Problem: the heightmap doesn't show …

0
129
Member Avatar for alex-VX

when i try to compile stuff i get this [code=c++]c:\program\microsoft visual studio 10.0\vc\include\codeanalysis\sourceannotations.h(53): error C2143: syntax error : missing ';' before '{' c:\program\microsoft visual studio 10.0\vc\include\codeanalysis\sourceannotations.h(53): error C2871: 'vc_attributes' : a namespace with this name does not exist c:\program\microsoft visual studio 10.0\vc\include\codeanalysis\sourceannotations.h(53): error C2447: '{' : missing function header (old-style …

Member Avatar for jonsca
0
475
Member Avatar for sahil1991

hi, i was just wondering if there is some special technique to understand the code which is not yours.i may sound peculiar so letme make it a bit clear.i hav just recently done some c++ programming and being able to make some programs.not too complex but i can do some …

Member Avatar for sahil1991
0
211

The End.