49,756 Topics

Member Avatar for
Member Avatar for lewashby

I'M trying to compile a very small cout<< console application in MSC C++ but the program flashes up and goes away so quick that I can't see anything that's going on. Below are my headings, what's missing? Thanks. #include <Stdafx.h> #include <iostream> using namespace std;

Member Avatar for Nick Evan
0
243
Member Avatar for iismitch55

I have been researching ways to make a DOS window disappear when starting a program. I have solved this, by using getconsolewindow() and setwindow(). The thing is, I still get a blip where the DOS appears for a couple miliseconds. Is there a way to fix that? Clip of code: …

Member Avatar for iismitch55
0
919
Member Avatar for PeTo.

I'm having some trouble making my snake move :D I can move one point in any direction but the whole body of the snake is where I'm confused , if(a == (char) 119 || a == (char) 87 || a == 72) { y=y--; gotoxy(x,y); PrintVector(v); } thats works just …

Member Avatar for PeTo.
0
2K
Member Avatar for rahim_fayaz

Hi I am getting this error when running a very similar code like the below. I have memory problem,but i dont know how can solve it. please help. Thanks in advance. /////////////////////////////////////////// ~~~~~~~ERROR~~~~~~~~ terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc Aborted /////////////////////////////////////////// ~~~~~~~~Code~~~~~~~~~ int main(){ /** Declare …

Member Avatar for rahim_fayaz
0
139
Member Avatar for samar11

please help me coding this in c++:  Inverse matrices.  Calculate matrix determinant.  Set a row or a column of the matrix to a certain value.  Calculate performance (time and memory taken by each algorithm).

Member Avatar for samar11
0
164
Member Avatar for PuQimX

i have read a txt file into queue just like below example which is i can do it.. the problem is i how to read Tab Delimited Files which i want file size to multiple by 0.6... because i want to create handle a printer simulation using queue...sorry for my …

Member Avatar for PuQimX
0
158
Member Avatar for Despairy

I have read a file with around 120k words so i try to do it fast. have seen the: int x = setvbuf(fp, (char *)NULL, _IOFBF, BSZ); assert( x == 0 && fp != NULL ); option but it takes more than a second ( 1 mb file) so now …

Member Avatar for Despairy
0
282
Member Avatar for drichird

In Python: #python class myClass: istat = 111 #exists as soon as import class def __init__(self): print("in ctor") self.iauto = 222 #does not exist until instance created ..... mc1 = myClass() mc2 = myClass() In C++: //C++ class myClass { public: static int istat; int iauto; }; ..... //main myClass …

Member Avatar for Gribouillis
0
802
Member Avatar for Miz_LiLO

I cant display this output..how i can i declare the gender n relate it with my price..i stuck here..oop c++ i have 2 coding for this..which 1 is better..im new in this progrmmer.. void eSalon::priceCurling() { cout<<"\nYour Gender is: "<<gender; if (gender=female) { cout<<"Long Hair Rm30-RM49"<<endl; cout<<"Short Hair RM50-RM100"<<endl; } …

Member Avatar for ravenous
0
116
Member Avatar for bufospro

Hi all, I have to make a project on my School until 18th of May. I am using resEdit to make graphics for a c++ program. But there ara a lot of cases that the program crashes. Could you help me ? I don't know to use resEdit good so …

0
79
Member Avatar for eagle_phoenix2

I am using visual studio 2010. I wanted to compile my cpp from cmd. I can compile it using "cl file.cpp" comand in visual studio developer command line tool. But I wanted to compile it from the built in cmd of windows. When I try to use the command "cl …

Member Avatar for eagle_phoenix2
0
669
Member Avatar for khuzdaar

I am familiar with loops, functions, recursions, (though I have praticed some questions, it is troubling to get the hang of it completely), passing by value, reference and ofcourse pointers. I can work with arrays and 2d arrays. This is my second project. My first project was hangman. My sir …

Member Avatar for khuzdaar
0
514
Member Avatar for anonymous1987

Please Help!!! My understanding of getopt is very limited. I do however realise that argv[0] is the exe file, argv[1] is the option, argv[2] is the word to compare and argv[3] is the dictionary or document I want to search(file .txt). I'm trying to set a pointer to the dictionary …

Member Avatar for ravenous
0
254
Member Avatar for jonnyboy12

Hello all. I have come to the conclusion that when i try to use images for backgrounds in my windows forms, these images have to be exactly the same size as the form or else when i move the form it will cause the form to shake. The problem with …

Member Avatar for jonnyboy12
0
152
Member Avatar for triumphost

I want to start developing an IDE or at least a Syntax highlighter into my program. Atm it's a simple text editor with basic copy paste functions. How does Notepad++ do it? Is there a way I can integrate that into my own program? If not then I'll write it …

Member Avatar for mike_2000_17
0
1K
Member Avatar for annitaz

#ifndef FILM_H #define FILM_H #include <QString> class Film { protected: QString title; double dailyRate; public: Film(QString ti,double dr); QString getTitle() const; virtual double calculateRental(int num)const; }; class Video: public Film { public: Video(QString ti,double dr,QString vt,int d); QString getTitle() const; QString getVideoType() const; virtual double calculateRental(int num)const; protected: QString videoType; …

Member Avatar for annitaz
0
230
Member Avatar for Clinton Portis
Member Avatar for Nick Evan
0
159
Member Avatar for Labdabeta

I used to use a tutorial for windows console API, but the website was taken down :(. So now I need to ask how to do these things (which ALL were included on the website) in the console with windows API: * Mouse events (clicks and unclicks) * Cursor seeking …

Member Avatar for Labdabeta
0
194
Member Avatar for deppy

Please write a program that will asks to give an integer number K that will be higher than 20. If the number is not higher than 20 then make the program to show a relevant message and then ask to insert again the number K. After that, depending on the …

Member Avatar for deppy
0
209
Member Avatar for rafaquatbutt

Write a program for an application that does not tolerate erroneous input data. Therefore, the data values are prepared by entering them twice by the user. Two lists are made by getting positive integers from the user, separated by a negative number. These two lists of numbers should be identical; …

Member Avatar for Ancient Dragon
0
73
Member Avatar for lewashby

I just downloaded netbeans and when I went to start a C++ project I was told that Netbeans couldn't find a C++ compiler. When I use to play around witt MS Visual C++ I never ran into a problem like this, Can anyone tell me what's up and what I …

Member Avatar for lewashby
0
147
Member Avatar for sesan2007

please am new into programming and i was given a project to create a premier league table using C can any 1 help me thanks a lot

Member Avatar for nitinmbhanu
0
212
Member Avatar for BryantFury

Hi ive made a code does the following: 1. user makes a list of items 2. user adds more items to the list 3. list is displayed it uses Linked-Lists. here is the code #include <iostream> using namespace std; struct vote { char product[10]; vote *votePtr; }; void addNodes(vote *&startPtr,vote …

Member Avatar for BryantFury
0
250
Member Avatar for Labdabeta

I have a C++ console project in Code::Blocks and I have set breakpoints to test an error. I have set the build for the project to produce debugging symbols for the debug build. I built it, then when I hit debug it just ignored my breakpoints and skipped to the …

Member Avatar for Goemon
0
9K
Member Avatar for binningen

Hi, I'm trying to write a function that enlarges a dynamically allocated array, but I am having some trouble doing so. Here's my code: void enlargeArray(int *oldArr, int arraySize) { //oldArr is a dynamically allocated array int *newArr = new int[arraySize*2]; //copy the elements from oldArr into newArr delete oldArr[]; …

Member Avatar for mike_2000_17
0
165
Member Avatar for mayapower

Hi, I am trying to create a programe like this: n1 = NAttrib() n2 = NAttrib() out = NAttrib() NAttrib class can be considered as general purpose attribute. f1 = FloatAttrib(1.0) f2 = FloatAttrib(2.0) FloatAttribute class is like float type but with some extra spices. It has operator overloading functions …

Member Avatar for mike_2000_17
0
252
Member Avatar for nitinmbhanu

//PROGRAM TO FIND DERIVATIVE(FIRST AND SECOND)OF POLYNOMIAL FUNCTIONS #include<iostream.h> #include<conio.h> void main() { int i,d,coeff[100],degree[100]; clrscr(); cout<<"\nEnter the degree of the polynomial : "; cin>>d; for(i=d;i>=0;i--) { if(i>1) { degree[i]=i; cout<<"\nEnter the coefficient of x^"<<degree[i]<<" (with sign) : "; cin>>coeff[i]; } else if(i==1) { degree[i]=i; cout<<"\nEnter the coefficient of x …

Member Avatar for mike_2000_17
0
1K
Member Avatar for rahulraj9

matrix operation please help me coding this in c++: - Inverse matrices. - Calculate matrix determinant. - Set a row or a column of the matrix to a certain value. - Calculate performance (time and memory taken by each algorithm).

Member Avatar for nitinmbhanu
0
154
Member Avatar for BryantFury

hi im currently learning about linked list. Ive created a code which is supposed to let you type some numbers, then display them. i did this mostly by using information on the internet(code examples) and such. Hence there are obvious mistakes a bits i do not understand. Here is my …

Member Avatar for BryantFury
0
167
Member Avatar for greencode

Hello, I'm working on an assignment that requires me to do the following: "A file contains 6 numbers per line and contains several records. Another file contains 3 numbers per line and several records. Write a program to input each of the numbers, find the highest number, the lowest number, …

Member Avatar for WaltP
0
322

The End.