49,757 Topics
| |
Can anyone tell me whay the following funtion that should be returning true if the year is leap year and false if it is not, is givign me unexpected results? when I entered 1985 I got true? when I entered 2012 I got false. When I entered 2000 I got … | |
So I was asked to write some simple functions that would search through an array of length (s) and tell how many times an (integer, double etc. ) appeared within the array. It's pretty simple because they give you the length of the array. However one of the functions doesn't … | |
I am trying to do a C++ coding. I am trying to do problem in which i have numbers of points. Now i need to find the path that goes through all the points. This is not actually TSP because as per my knowledge in TSP it is possible to … | |
can anyone help me to fix this problem ? i can delete the midder and the tail of the node , the only problem is i cannot delete the head node when i have more than one node. ---------------------------------------------- #include<iostream> #include<string> using namespace std; class linklist { private: struct node{ … | |
i wanna know ina easy way what do we ,mean by inheritance and hybrid inheritance in c++ | |
Hey, I have never programmed before, so everything is very confusing for me. I was given an assignment to change binary to a decimal number. Not very much information was given to me. I am NOT looking for an answer, but I definitely am looking for some help as to … | |
Hi guys, trying to figure out why i can't insert this LinkList i create (TrainA) can't be placed into the Queue. I keep getting the error 'trainA' was not declared within this scope. Any help will be cool thanks! class Link { public: int iData; // data item (key) double … | |
A solution for the "Hartals" problem. Problem description: http://icpcres.ecs.baylor.edu/onlinejudge/external/100/10050.html Author: [Joana Matos Fonseca da Trindade](http://joanatrindade.wikidot.com) #include<stdio.h> int main() { int i,j,k,a,b,h,hd[100000],n,p,pd[150],tc,t,s; while(scanf("%d",&tc)==1) { for(i=0;i<tc;i++) { h=0; s=0; scanf("%d",&n); scanf("%d",&p); for(j=0;j<p;j++) scanf("%d",&pd[j]); for(j=0;j<p;j++) for(k=pd[j];k<=n;k+=pd[j]) if(k%7!=0 && k%7!=6) { h++; hd[h-1]=k; } for(a=1;a<h;a++) for(b=h-1;b>=a;b--) if(hd[b-1]>hd[b]) { t=hd[b-1]; hd[b-1]=hd[b]; hd[b]=t; } for(t=1;t<h;t++) if(hd[t]==hd[t-1]) … | |
can anyone help me to slove the problem ?? i wan to delete a node either form the head , midder or last , then print out all the node . #include<iostream> #include<string> using namespace std; class linklist { private: struct node{ struct student{ string name; int id; string prog; … | |
Right everyone, here's my problem. I have just paid £45 for a book on Qt, have had a nightmere getting it sorted, and finally I can build apps to this extent... I have an app, *test.pro*. I have built it using `qmake test.pro` -> `make` which works. I am using … | |
Im reading a text file and storing the characters in an array. I get a "Unhandled exception at 0x0109985e in Executable.exe: 0xC0000005: Access violation writing location 0xcccccccc." void drawMap(string MapLoc) { int i = 0; int x = 0; int y = 0; char* arrayMap[5225]; ifstream mapReader; mapReader.open(MapLoc); for (i … | |
Hello All, i have a small question regarding casts in C++. 1) Now, dynamic_casts ensure safety with casts. ie. for example: for the below polymorphic class: class Base { public: virtual void foo() {} }; class Derived : public Base { }; int main() { Base *bPtr = new Base; … | |
I have a project and a part of it is related to sha 1 encryption using openMP. Any help would be highly appreciated. | |
consider the following program #include<iostream.h> #include<fstream.h> void main() { int no; ifstream fin; ofstream fout; fout.open("create,dat",ios::app); fout<<"What is your fav. number"; fin>>no; fout<<no; fout.close(); } NOW HERE IS THE PROBLEM WHILE THE PROGRAM IS RUNNING PERFECTLY AND THE NUMBER IS BEING STORED IN A .DAT FILE BUT THE NUMBER IS … | |
I'm asked to write a program in which the user inputs a letter and the program converts it to lower case if it's UPPER and vis versa. I have written this program and it worked: #include<iostream> using namespace std; int main() { char letter; cout<<"Enter any letter"<<endl; cin>>letter; if(letter>=97&&letter<=122) { … | |
Hi I am allocating memory space and adding nodes like this: CSprite* pNewSprite = new CSprite; // Create new sprite pNewSprite->iData = iChoice; // Attach data EnemyList->AddNode(pNewSprite); // Send to AddNode and also in the ::AddNode: void CLinkedList::AddNode(VOID* pData) { CNode* pNewNode = new CNode; // Create the Node pNewNode->pData … | |
Hi I am new to programing and I want to learn some basic tings. I also want to learn to create basic games. Could anyone reccomend a good book or websiteto get me started? Thanks, Robbie | |
hi ! how can i do a one-way-circular linked list function that gives to me** merge 3 lists** such as struct node{ int data; node *flink; node *blink; }; void concatenate(node *&L1,node *L2,node *L3) { ??? } | |
can anyone help me to solve this problem ? i cannot excute this program. ----------------------------------------------------------- #include<iostream> #include<string> using namespace std; class linklist { private: struct node{ struct student{ string name; int id; string prog; double cgpa; }st; node *link; }*head; public: void linklist_1(); void linklist_2(); void insFirstNode (string name, int … | |
Hello all... My project is to parallelize the MD5 program using OpenMP (omp). so please help... This is test.cpp: #include <stdio.h> #include <omp.h> #include <iostream> using namespace std; #include "md5.h" int main(void) { int n; double time1, time2; time1=omp_get_wtime(); cout << "\n The MD5 of 'zzzzzz' is : "; cout … | |
the loop runs infinte for the second ittiration //attempt two to make the student data base the other way // this program runs onlu once and does not hav any data base once u exit #include<iostream> #include<conio.h> using std::cout; using std::endl; using std::cin; int count=0; class student { double m_roll[100],m_class[100]; … | |
I'm trying to be clear about registry, and would hope someone might confirm, or not, that my interpretation is correct. I read [here](http://msdn.microsoft.com/en-gb/library/windows/desktop/ms724072(v=vs.85).aspx) > The parent of each 64-bit registry node is the Image-Specific Node or ISN. The registry redirector transparently directs an application's registry access to the appropriate ISN … | |
In code like int `main(int argc, char **argv)`, I'M trying to understand command line arguments a little better. And what would be the difference between `char ** argv` & `char * arg[]`? Thanks. | |
so i am on my last 2 programs for my programminng course and i only have till monday(3 days) to do both of them here are the guidlines for the first project: 14-1 Write a program that declares an array of ten floating point values. Have the program prompt the … | |
An integer double-dimensional array called hotel is used to keep track of reservations in an hotel of 5 floors each floor having 8 rooms. The floors are numbered 1, 2, 3, 4, and 5, and the rooms are numbered 1, 2, 3… 8. Write a C++ program to manage the … | |
Hi, I'm trying to create a *link like* label in a win32 application. VS2010 I generally find an API I can use but I'm having no luck with it currently. Just wondering if anyone has some Ideas? just a starting point will be great. Appreciate you reading, thanks. | |
Hi Everbody: To get rid of specific warning in 2008 vc++ or 2005 vc++ 1>c:\documents and settings\user\my documents\visual studio 2008\projects\gmt\gmt\gmt.cpp(25) : warning C4996: '_gmtime64': This function or variable may be unsafe. Consider using _gmtime64_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 1> c:\program files\microsoft visual studio … | |
For those of you familiar with the latest C++ standard, what do you think of [uniform initialization](http://en.wikipedia.org/wiki/C%2B%2B11#Uniform_initialization)? Listening to folks like Herb Sutter, it seems like the intended purpose is to be completely pervasive, which obviously changes the look and feel of C++. Do you plan on using it everywhere … | |
[LEFT]okay, I've got a connect four, 2 player, console game due today, and I've got everything pegged down except for checking for a win, I've tried multiple things, ifs, whiles, fors, and I only have around 5 weeks of experience in C++, with around 15 hrs of class every week. … |
The End.