49,761 Topics

Member Avatar for
Member Avatar for sha11e

Heard people say c# for big programs, c for fast programs and c++ is just something that failed at being object oreanting c is c++ useful?

Member Avatar for sergent
0
211
Member Avatar for jjssll

Hi guys, I'm new in C++ and I tried to compile the attached code without success. This is the output when using g++ under Ubuntu system /src$ g++ -c -Wno-deprecated -I../include Options.C Options.C: In constructor ‘Options::Options(const char*)’: Options.C:13: error: ‘parsequestion’ was not declared in this scope I tried several modifications …

0
131
Member Avatar for programing

i am write program that insert at tail in circular singlelinkedlist but i have some errors .. [ICODE]#include<iostream.h> struct node { int info ; node * next ; }; class clist{ private : node *tail; int size; public: clist(){ tail=NULL; size=0; void addtail(int x){ node *p=new node; p->info=x; if(tail==NULL) p->next=p; …

Member Avatar for programing
0
93
Member Avatar for sha11e

After some google-ing I found a page saying that .o files are " “Object Code” is just the translation of “Source Code”, which can be referred as machine language code." What .depend files are I didn't really understand. Someone said it... kinda... links to libraries or something? Else my exe …

Member Avatar for nezachem
0
178
Member Avatar for L0s3r

[CODE]class mymatrix{ private: int** arr; int m ,n; public: mymatrix() { std::cout<<"\nConstructor entered."; std::cout<<"\nEnter no. of rows of the matrix:"; std::cin>>m; std::cout<<"\nEnter no. of columns of the matrix:"; std::cin>>n; arr = new int*[m]; for(int i=0;i<m;i++) { arr[i]=new int[n]; } std::cout<<"\nConstructor exited."; } /****************************************************************************************/ mymatrix (mymatrix& t) { m=t.m; n=t.n; std::cout<<"\nCopy …

Member Avatar for L0s3r
0
187
Member Avatar for Labdabeta

I am making a diplomacy tool, for the board game diplomacy. I need to make a map of each territory. I have a 75 #define MAP_"NAME" lines but I don't know how to set them to a mask value that can be checked since I don't know any 75-bit or …

Member Avatar for Labdabeta
0
197
Member Avatar for pengkeanh

Hi All, For each element in data1, I need to figure out what elements in data2 are related to it. Also, for each element in data2, I need to figure out what elements in data1 are related to it. Therefore, I setup a mutual data structure as you can see …

Member Avatar for pengkeanh
0
344
Member Avatar for noobcoder

Hello all, I will be placing my source code onto pastebin and making it private as I am scared of my fellow students stealing my hard work for this class. So far I have about 1000 lines of code that is pretty easy to understand and it compiles and runs …

Member Avatar for noobcoder
0
2K
Member Avatar for britanicus

This is a part the extension module im writing for python using c++. ( The complete source is available as an attachment ) [CODE] #include <python2.6/Python.h> #include <iostream> #include <fstream> #include "structmember.h" using namespace std; typedef struct { PyObject_HEAD fstream file; } CppFileObject; static int CppFile_init( CppFileObject *self, PyObject *args …

0
75
Member Avatar for tikoti

Hi! I am looking for something to compact the clear and push_back in one line... [CODE] std::vector<int> v(3,100); v.clear(); v.push_back(4); [/CODE] I have thought that vector::swap may be usefull for this task but still figuring out how. Any sugestion or idea? Thank you in advance!

Member Avatar for tikoti
0
170
Member Avatar for pcgamer2008

Hello World !!! I am having problem in my project regarding mouse click within a particulr area on GL surface screen...when I click on that particular area..mouse click generates windows coordinate like (200,349). It's hard to sense the mouse click in that area on GL surface screen....so how can I …

Member Avatar for mike_2000_17
0
121
Member Avatar for dyingatmidnight

Okay this feels like a really silly question. Values that I have set to private should be able to be used through out that class alone, yeah. Say I have this: [code] #include <iostream> using namespace std; class Telegram{ public: Telegram(); ~Telegram(); void getData(); private: int **telegram; int rows, cols; …

Member Avatar for Narue
0
95
Member Avatar for geekme

While compiling a simple code in c++ i get the errors C:\Users\ila\Desktop\mule\mule.c|1|iostream: No such file or directory| C:\Users\ila\Desktop\mule\mule.c||In function `main':| C:\Users\ila\Desktop\mule\mule.c|6|error: `cout' undeclared (first use in this function)| C:\Users\ila\Desktop\mule\mule.c|6|error: (Each undeclared identifier is reported only once| C:\Users\ila\Desktop\mule\mule.c|6|error: for each function it appears in.)| ||=== Build finished: 4 errors, 0 warnings …

Member Avatar for JasonHippy
0
776
Member Avatar for pritpal.singh88

[code]ofstream f; char c; f.close(); f.open(s.c_str(),ios::out); if(f.is_open()) { cout<<"Press <q> to save file"; char *text; int count=0,count1; while(1) { system("stty raw -echo"); cin>>c; cout<<c; system("stty cooked echo"); text[count]=c; ++count; if(c=='q') { text[count]='\0'; while (text[count1]!='\0') f.put(text[count1++]); f.close(); break; } } [/code] please help me out in this syntax i was not …

Member Avatar for jonsca
0
111
Member Avatar for geekme

I need to implement graphics in c++.what IDE should I use and what are the library files required for it? Note-I have just a week time so please tell some suitable way by which I can learn. Regards

Member Avatar for Kanoisa
0
210
Member Avatar for lowhzplayinfool

I've been working for a while now on a module assesment which is due in tomorrow. The trouble I have is that I have an extension, the module has finished and there is no one in my school to ask since it's been the Easter holiday :( Instead of 'borrowing' …

Member Avatar for lowhzplayinfool
0
131
Member Avatar for geekme

while debugging my code in code blocks I always get this error "<filename> - Debug" uses an invalid compiler. Probably the toolchain path within the compiler options is not setup correctly?! what should I do?

0
59
Member Avatar for msrox

Hi there, I am new in C++/CLR. I am trying to access to Form1 property from a header file, but I can't. I have included this header file in Form1.h. Here is the source of the header file: // General.h #ifndef GENERAL_H #define GENERAL_H #include "Form1.h" void ChangeFormText() { Form1^ …

Member Avatar for Ancient Dragon
0
423
Member Avatar for peq

Title says it all, basically I'm just trying to print the pointer *p to display all the values in that array. [CODE]#include <iostream> #include <string> //#include <stdlib> using namespace std; void extend(double *p, double *q, double *a, int c); int main() { const int CONST = 10; double price[CONST] = …

Member Avatar for peq
0
204
Member Avatar for ragnarok511

I am currently a C# developer with about a year of experience. I am currently working on finishing my computer science degree with a minor in mathematics. I love the job that I am in, but I the things I really want to do are in C++ (i.e. game development, …

Member Avatar for thelamb
0
238
Member Avatar for geekme

I'm unable to use code blocks.I do not know how to compile and run code in this IDE.Please help.

Member Avatar for sfuo
0
38
Member Avatar for ronthedon

I've spent the last hour trying to figure out why my calculations are not adding up. Once i run the program it just output 0 for the total points program averages and etc and it also leaves student name blank. Can someone please help me figure out the issue. thanks …

Member Avatar for jonsca
0
178
Member Avatar for bigdan182

hey guys, im fairly new to this so feel free to tell me if i need to supply more info. basically i need to write code to read in a text file and store different values in different variables, so for example i would read in: bob 1.1 maths 1.2 …

Member Avatar for abhimanipal
0
248
Member Avatar for kucing

[code] 1: int main() 2: { 3: unsigned short x; 4: unsigned short y 5: ULONG z; 6: z = x * y; 6: return 0; 7: } [/code] Please ... i got to many error. When I want z value to write in Textbox form window. Just like var …

Member Avatar for jonsca
0
234
Member Avatar for msrox

Is there any LED control to add to MFC project in order to have some graphic sense of e.g a timer?

Member Avatar for msrox
0
109
Member Avatar for IndianaRonaldo

[CODE]#include<stdio.h> #include<stdlib.h> #include<string.h> void main() { char* a[10]={"asd","QWE","ghj"}; printf("%s %c",a[2],a[2][2]); // prints properly... "ghj j" puts(a[1]); //prints properly..."QWE" a[1][1]='t'; //gives segmentation fault.... }[/CODE] what is the mistake in the code...??/..pls help..have an exam in 6 hrs...thank you....

Member Avatar for IndianaRonaldo
0
345
Member Avatar for GhostMonkey

Hey if I have a value that was p=3 in a for loop, and after a few loops it gets changed to p=6 is there anyway to say "go back to previous value"?

Member Avatar for L7Sqr
0
1K
Member Avatar for montjoile

I´m trying to develop an avl tree in C++, but I have problems with my rotation algorithm. I have try ALL the algorithms I could find on the web, but none of they works and I can´t see where is the problem. Here is my structure: [CODE] typedef struct node{ …

Member Avatar for montjoile
0
273
Member Avatar for yongj

So I have a "base" class called "SortData". When I try to allow my other header file "InsertionSort.h" inherit this base class, I keep getting a class type redefinition error. What am I doing wrong? Here's the base class header: [CODE] // SortData.h #include <iostream> using namespace std; class SortData …

Member Avatar for yongj
0
103
Member Avatar for loafie55

Create a program that is a Point of Sales (POS) system for a restaurant. Your POS system should allow unlimited orders from any number of guest. Each guest should be able to order a drink, an appetizer, an entree, and a dessert. The program should present a total. In addition, …

Member Avatar for loafie55
0
3K

The End.