49,762 Topics
![]() | |
Im trying a practice problem from a textbook and here is my attempt at it, was wondering if I could get some advice both with structurally how to approach the problem, efficency, and any words of wisdom on dynamic memory. This is my study for my final exam which so … | |
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? | |
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 … | |
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; … | |
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 … | |
[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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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! | |
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 … | |
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; … | |
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 … | |
[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 … | |
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 | |
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' … | |
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? | |
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^ … | |
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] = … | |
![]() | 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, … |
I'm unable to use code blocks.I do not know how to compile and run code in this IDE.Please help. | |
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 … | |
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 … | |
[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 … | |
Is there any LED control to add to MFC project in order to have some graphic sense of e.g a timer? | |
[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.... | |
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"? | |
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{ … | |
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 … |
The End.