48,985 Topics

Member Avatar for
Member Avatar for clutchkiller

Assuming that a year has 365 days, write a class named DayOfYear that takes an integer representing a day of the year and translates it to a string consisting of the month followed by day of the month. For example, Day 2 would be January 2 Day 32 would be …

Member Avatar for clutchkiller
0
303
Member Avatar for agnetta22

this is the program // file: am00201.cpp // author: a.montes de oca #include <iostream> using namespace std; int main() { int a[16] = {67, 111, 110, 103, 114, 97, 116, 117, 108, 97, 116, 105, 111, 110, 115, 33}; int i; char letter; i = 0; while (i < 16) …

Member Avatar for adnan.siddique
-1
122
Member Avatar for psdao1102

[CODE]#include <fstream> #include <iostream> #include <cassert> using namespace std; int main() { ifstream inFile; ofstream outFile; inFile.open("file.txt"); assert(!inFile.fail()); cout << "everythings fine" << endl; cin.ignore(); cin.get(); return 0; }[/CODE] This is my current code, file.txt doesnt exist. The program simply crashes. I was hoping for an error message explaining what …

Member Avatar for Ancient Dragon
0
115
Member Avatar for chuong3a

Help me to find the error in Prim code, thanks. [CODE] #include <iostream.h> #include <stdio.h> #define MAX 10 class prims { private: int cost[MAX][MAX], tree[MAX][MAX]; int n; public: void readmatrix(); int spanningtree (int src); void display (int cost); }; void prims :: readmatrix() { int i, j, k; n = …

Member Avatar for chuong3a
-1
94
Member Avatar for SpyrosMet

Hello. I'm a newbie and i was wondering if anyone can tell me how to create an array that contains objects and number 0 wherever there is no object. Thanks in advance

Member Avatar for kvprajapati
0
118
Member Avatar for atticusr5

Hello everyone, I am a C++ newbie and I am running into some linking errors. I am using Vi to compile and link my code. Here are the linking errors: assign6.o: In function `cAccountList::cAccountList()': assign6.cpp:(.text+0x1db): undefined reference to `cAccount::cAccount()' assign6.o: In function `cAccountList::cAccountList()': assign6.cpp:(.text+0x22b): undefined reference to `cAccount::cAccount()' assign6.o: In …

Member Avatar for Ancient Dragon
0
103
Member Avatar for atticusr5

Hey everyone I am writing some code for my c++ class and in this program I am trying to sort back account information by there accountID #'s. When I try to compile, here are the errors I get: assign6.cpp: In member function ‘void cAccountList::sort_by_ID()’: assign6.cpp:110: error: ‘accountID’ was not declared …

Member Avatar for Narue
0
139
Member Avatar for sadhramani

[code] int do_openFile(void) { char *p ; /* pointer to outFileName */ char *m ; /* pointer to report date */ char *mon; /* month number in report date */ /* get output file name */ m = pk->CNCRptdate; m += 2; strncpy(mon, m, 2); p = outFileName ; strcpy(p, …

Member Avatar for Narue
0
151
Member Avatar for Szabi Zsoldos

I would like that case 1: should display how many elements do i want, and that i can assign values to those elements. Mine because of the j++ goes infinite, so i can enter infinite values to infinite arrays. How could i do this? Cate elemente vrei sa adaugi: 3 …

Member Avatar for Szabi Zsoldos
0
544
Member Avatar for noey699

Every thing works perfectly only it will not check for a full house. Ive tried to figure out what the problem was by rewriting pair checking and three of a kind checking but the same result always. The function simply returns an integer corresponding to the hand stength given a …

Member Avatar for noey699
0
146
Member Avatar for m_adeelkhan

i need help in making c++ code for tic tac toe on 7x7 board by using mini max and alpha beta where 4 in a row ,column,and diagonal are winning state , if some 1 can share code it will be quite help full 4 me

Member Avatar for WaltP
-1
155
Member Avatar for Zay

Hello; can we give the variable in struct an initial values ? ex: struct example{ int id; float gpa; string name; }; can we but this inside the structure : int id=34440; the same Q is for the Class ? can we intialize the variable when definr it for the …

Member Avatar for mrnutty
0
96
Member Avatar for falcon60

Hello. I'm new to C++ and I just learned how to use vectors and lists and indices and iterators, but i'm confused about iterators. Mainly, why should I use them instead of indices? They seem to add more complexity to accomplish the same thing as using indices... so could someone …

Member Avatar for Salem
0
71
Member Avatar for Dizzzy

Ok i have a char with ''/afile.html" assigned to it. The extensions of it can vary so i need to get the extension to a seperate char to compare it with something else il show you what i have.... Basically i need everything after the '.' [CODE]char resource[16]; n = …

Member Avatar for Dizzzy
0
136
Member Avatar for SpyrosMet

the error by the compiler is [code=text]Compiler: Default compiler Building Makefile: "C:\Dev-Cpp\Makefile.win" Executing make... make.exe -f "C:\Dev-Cpp\Makefile.win" all g++.exe Untitled1.o plants.o -o "Project1.exe" -L"C:/Dev-Cpp/lib" Untitled1.o(.text+0x182):Untitled1.cpp: undefined reference to `Plants::Plants()' collect2: ld returned 1 exit status make.exe: *** [Project1.exe] Error 1 Execution terminated[/code] main code is [code]#include <iostream> using std::cout; using …

Member Avatar for SgtMe
0
128
Member Avatar for C++ Beginner

Problem: Write a pgoramthat uses a structure to store the following information: Name, IdNum, Test1Score through Test4Score, average, and grade. function to ask the user for student's name, etc. The average score should be calculated and stored in the Average member of the structure should be calculated in their own …

Member Avatar for C++ Beginner
0
260
Member Avatar for Aiyen

Hello all, great forum that have been a great source of information for me over the past many weeks. So now I decided to join up. I am currently trying to write a partial sum function as part of a much larger program I once wrote in Fortran. I am …

Member Avatar for Aiyen
0
89
Member Avatar for SpyrosMet

Dev cpp gives me the error 18 C:\Dev-Cpp\Untitled1.cpp request for member `setStats' in `plant1', which is of non-class type `Plants ()()' And the same for line 19. Please someone tell me what's wrong. I'm a noob at c++. Thanks in advance. #include <iostream> using std::cout; using std::cin; using std::endl; #include …

Member Avatar for SpyrosMet
0
353
Member Avatar for mmasny

If we have three classes A,B,C declared as follows: [code=C++] class A{ protected: int x; }; class B : A{ //... }; class C : B{ //... }; [/code] does class C see its member x? It seems to me that it doesn't according to what the compiler says to …

Member Avatar for Fbody
0
118
Member Avatar for Chetan_

Hi! I'm making a graph generator. Most is done but the only problem is that when i'm doing the 2nd or 3rd graph in the same session, the graph collapses . and after the end of execution of the program, i get "Null pointer assignment" I tried debugging but i …

Member Avatar for mitrmkar
0
178
Member Avatar for smarty_t2

Can someone please tell me the difference between Class and Structure in C++ ??? I cant find any..!! Thanks

Member Avatar for jonsca
0
97
Member Avatar for isralruval

This code you are asked to input a number and it will tell u wheter or not the input you entered is in the array or not i am having issues with this code and its giving me some errors, if anyone wants to help me out it will be …

Member Avatar for jonsca
0
112
Member Avatar for Servet Yekta

Hello everyone, I'm trying to improve myself on Winsock , so I wrote a code which can get the content of an website.Now I'm trying to post (upload) a file to a http website.Here is my code , what should I add to my code to work with POST? Thanks …

Member Avatar for Servet Yekta
0
189
Member Avatar for fiaz ranjha

i have oop in c++ in some detail but i am not familair with java.please help me to write five sentences in prose or cons of this statement "c++ supports more oop features as compared to jave" please help me

Member Avatar for jonsca
0
81
Member Avatar for niknailer

[b]Split from - [url]http://www.daniweb.com/forums/thread255859.html[/url][/b] I think I may be in the same class as rwill357 and I am having some problems getting my code correct too. I appreciate the help that you have given so far. I have made the changes that you suggested. I'm not sure where I'm going …

Member Avatar for jonsca
0
93
Member Avatar for Christoph928

I need help with decrypting a 12 character message located in a file named encrypted.txt then printing the decrypted message to the screen and a new file named decrypted.txt. This is what i have so far... and don't understand how to print the char to the screen as a letter …

Member Avatar for Christoph928
0
143
Member Avatar for dude1

i have a numeric updown that goes from 0-99 and it works but i want to make it continuous so if i hit the down when its at 0 it goes to 99 and when its on 99 and i hit up it goes to zero anyone know the code …

Member Avatar for jonsca
0
148
Member Avatar for Web_Sailor

Hi gurus, I have a simple question regarding file parsing. I am trying to parse a file and store the fields I require in a multimap. Now I want to pass an array which is of int type and specifies field number to be extracted in a file. I am …

0
53
Member Avatar for isralruval

im having a difficult time figuring out my last two functions. first one which is the int divelement(int a[], int size); this function is suppose to find and print the elements of my array that are only divisible by 5, so the answer will be like 10,15,90, and 95. i …

Member Avatar for mrnutty
0
99
Member Avatar for stjohn999

this is my daughters homework she asked me to help and now im stuck she has worked it out and is making me look stupid need to get my selfrespect back even if i have to cheat(i used my brain and im asking you) the code is as follows but …

Member Avatar for WaltP
-1
78

The End.