49,766 Topics

Member Avatar for
Member Avatar for darelet

Hi all, I've been trying to work on solving this myself but failed short of new ideas. I am experiencing memory heap errors ever since I tried to transfer some functions (for calculating statistics i.e. getMode/getMean/getVariance) into a new class in the spirit of OOP. Compiler error is... --> This …

Member Avatar for mitrmkar
0
383
Member Avatar for memstick

I'm growing increasingly confused by the '^' symbol. I have been able to track it down on various sites but there is no real "definition" of it and its usage anywhere. I am creating a .NET project these days and I bumped into the symbol for the first time in …

Member Avatar for memstick
0
88
Member Avatar for sky_aeron

[code]#include<stdio.h> void main(); { clrscr(); char a,b,c; printf("The quick brown fox jumped over the lazy dog"); getch(); }[/code]

Member Avatar for jonsca
-1
71
Member Avatar for carrythe1

Hi, I know the code for this post is quite long, but I thought it would be best to be comprehensive about what i'm trying to do as i'm not exactly an expert in this area of programming. I'm stuck trying to work out how to get windows hook procedures …

Member Avatar for carrythe1
0
2K
Member Avatar for genie0582

I use Dual OS. C: is Vista and F: is XP package 3. I downloaded code::blocks from [URL="http://www.codeblocks.org/"]here[/URL] and I also follow the instruction. I successfully installed in C: and I can compile "hello world" When I installed in F:, I cannot compile. though I changed the path from C:/~ …

Member Avatar for Stefano Mtangoo
0
36
Member Avatar for bubacke

hi all, i want to run a while (some condition holds) loop, and each time it is executed create a variable, a different one. my problem is: how do i get them to have different names, in particular, ongoing ones like "entry1", "entry2",... can i have like a counting integer …

Member Avatar for jonsca
0
54
Member Avatar for bubacke

hi, i want to have a vector of strings. i know i could declare it by [code] #include <iostream> #include <string> using namespace std; vector<string> vec; vec.push_back("this"); vec.push_back("is"); vec.push_back("my"); vec.push_back("array"); [/code] but thats very tedious. isnt there a more elegant way? if i had the vector as an argument to …

Member Avatar for bubacke
0
193
Member Avatar for Valaraukar

Ok, so I'm really after knowledge rather than a quick easy solution here. I am part of a team that is currently working on the development of a 'kind of' physics engine but I have hit a small wall since adapting the functionality of a class which was previously working …

Member Avatar for Valaraukar
0
201
Member Avatar for bbman

Hey, I have an item class: [CODE] #pragma once using namespace System; using namespace System::Drawing; ref class Item { public: Item(void); int Type() { return _type; } void Type(int value) { _type = value; } String ^ Text() { return _text; } void Text(String ^ value) { _text = value; …

Member Avatar for jonsca
0
130
Member Avatar for dhruv_arora

I created this function for my program : [CODE]int calcTotal() { petShop p; fstream f1; f1.open("Pet_Shop.dat",ios::app|ios::binary); int loc; loc=p.tellp(); float records; records=loc/sizeof(p); cout<<"Total number of records = "<<records; cout<<"Going back to main menu"; menu(); }[/CODE] I am getting this error : [CODE]error C2039: 'tellp' : is not a member of …

Member Avatar for dhruv_arora
0
99
Member Avatar for memstick

Hello! I am probably just going mad but. This code: [CODE]using namespace System.Windows.Forms;[/CODE] Generates the following error 1>GUItest.cpp(6): error C2143: syntax error : missing ';' before '.' 1>GUItest.cpp(6): error C2059: syntax error : '.' ..And I haven't the foggies why. Seems I cannot use .'s when declaring a namespace..

Member Avatar for memstick
0
122
Member Avatar for respondto

how can i make the ide word wrap when i am writing lines of code, the code goes so far in width that I have to use the arrow button on my keyboard to see the end of line dev c++ 4.9.9.2 windows xp

Member Avatar for NathanOliver
0
2K
Member Avatar for emcyroyale

Well I'm having quite a bit of errors with my code and have tried figuring out how to fix it, but I can't seem to figure out what is wrong. Here are the errors 1>------ Build started: Project: circle, Configuration: Debug Win32 ------ 1>Compiling... 1>circle.cpp 1>c:usersemcydocumentsvisual studio 2008projectscirclecirclecircle.cpp(38) : error …

Member Avatar for NathanOliver
0
200
Member Avatar for mybluehair

I need to create a new txt file using ofstream, but I need to use a string to name the file. For example: [CODE] string string1 = "testfile.txt"; ofstream myfile; myfile.open (string1);[/CODE] but when I try, it says I can do this because string is not a valid variable type …

Member Avatar for Danny_501
0
134
Member Avatar for mybluehair

I am trying to say "if variable is NOT greater than or equal to, then do this" Here is how I tried to write it: [CODE]if(mouse_x !>= 300){ blah blah blah }[/CODE] But my complier doesn't like that. Does anyone know what I did wrong? Thanks.

Member Avatar for dohpaz42
0
78
Member Avatar for deez2183

Design and run a program that takes a numerical score and outputs a letter grade. Specific numerical scores and letter grades are listed below: 90-100 = Grade A 80-89 = Grade B 70-79 = Grade C 60-69 = Grade D 0-59 = Grade F In this program, create two void …

Member Avatar for deez2183
0
468
Member Avatar for aj79

I am working in Microsoft Visual C++ 2008. Here is my sum of digits code: [CODE]#include <iostream> using namespace std; int main() { int num; int sum=0; cout << "Number, please? "; cin >> num; while (num>0) { sum=sum+num%10; num=(num-num%10)/10; } cout << "Sum of digits: " << sum << …

Member Avatar for aj79
0
214
Member Avatar for RussianKös

Hello. I'm very new at C++ world, so, I need some help. I'm building an Browser Called iNet, and, it gave me 4 errors: c:\users\sepultura\documents\visual studio 2008\projects\inet 0.1\inet 0.1\iNet.h(193) : error C2039: 'timer1_Tick' : is not a member of 'iNet01::iNet' c:\users\sepultura\documents\visual studio 2008\projects\inet 0.1\inet 0.1\iNet.h(22) : see declaration of 'iNet01::iNet' …

Member Avatar for jonsca
0
229
Member Avatar for uhmyeah

i am pretty new to c++ and dark gdk. im trying to make a simple platform game to start off. i have the basic controls down, the animations, and collision. but i am having much trouble finding how to create the effects of gravity. please help.

Member Avatar for nbaztec
0
167
Member Avatar for Kanoisa

Hi everyone, I'm not so sure if this belongs in here or in computer science but I think as I want to use c++ this may be the place. I was wondering if anyone could point me towards some tutorials/references or books on methods for approaching the design of larger …

Member Avatar for Bench
0
143
Member Avatar for Nexgr

I am trying to implement the A* algorithm in C++ ([url]http://en.wikipedia.org/wiki/A*_search_algorithm[/url]). The pseudocode i am trying to implement is: [code]function A*(start,goal) closedset := the empty set // The set of nodes already evaluated. openset := set containing the initial node // The set of tentative nodes to be evaluated. g_score[start] …

Member Avatar for Nexgr
0
168
Member Avatar for angelrapunzel

hi frnds!! i have d code for series x^!+x^2+x^3+....x^m with single loop only //wap to find sum of series and print series also //x+x^2+x^3+......x^n #include<iostream.h> #include<conio.h> void main() { clrscr(); int n,x,count1; int sum=0; cout<<"enter a number"; cin>>x; cout<<"enter nth term till which u want to compute"; cin>>n; int count=1; …

Member Avatar for NathanOliver
0
111
Member Avatar for Tejas

Can smeone help me to write a prog. to find the sum of the following series: 1+(1+2)+(1+2+3)+....... n terms Regds. TEJAS

Member Avatar for angelrapunzel
0
166
Member Avatar for CSherman

Hello all. I am working on this program and having some troubles with it. I have tried lots of different things and can't get it to do what I want. I guess I am not really understanding the code and how to word it properly. I am writing a program …

Member Avatar for Taywin
0
129
Member Avatar for vbx_wx

Hello. Can anyone help me how to implement the subscript ([]) operator for a STL list class ? [code] T& operator [] (int n) { } [/code] [code] template <typename T> class list { public: struct node { T data; node* prev; node* next; node(T t, node* p, node* n) …

Member Avatar for nbaztec
0
268
Member Avatar for nbaztec

Due to various posts asking for syntax highlighting, I decided to give it a shot & come up with a Syntax Highlighter for multiple languages. Also as many posters want to Copy it to Word, I added a functionality to directly export the highlighted code to MS-Word. Both the highlighting …

Member Avatar for nbaztec
1
143
Member Avatar for mebob

I have to make a program that takes 4 inputs and outputs the 2 largest inputs. So I wrote this code, [CODE] #include <iostream> using namespace std; void largest_two ( int input[4], int output[2] ) { bool restart; int i; int temp; do { restart = false; for ( i …

Member Avatar for thelamb
0
103
Member Avatar for jrw89

I've been trying to learn C++ for about a year now and came across [URL="http://openbookproject.net/thinkcs/cpp/english/chap04.htm"]this excellent tutorial[/URL]. I can't leave anything alone so I changed some single quotes to double quotes and have the following code:[CODE=C++]#include <iostream> void printTwice(char phil) { std::cout << phil << phil << std::endl; } int …

Member Avatar for jrw89
0
566
Member Avatar for invisi

Below is the code I wrote, for taking the arrow key imput, just wanted to share it and get some feedback thanks :) [CODE]#include <iostream> #include <conio.h> using namespace std; int main() { int number = 0; int number2 = 0; while(true) { int arrow = getch(); if (arrow == …

Member Avatar for invisi
0
189
Member Avatar for Thew

Hello everyone, I have a problem in my Borland C++ project. I need to use my own COM object written in C# (this COM allows me to directly print PDF files) in my another project in C++, but as soon as I call some COM functions which require a string …

Member Avatar for Thew
0
249

The End.