51,592 Topics

Member Avatar for
Member Avatar for crazylunatic

I have been doing a small project as part of my lab assignments and I encountered this funny probelm while working with the files in C++. I have this class Member which I am using to store the member details. [code=c++] class Member { private: char name[30]; long int userid; …

Member Avatar for deeps84
1
342
Member Avatar for Crisis757

{ int age; cout <<"Enter Age" << end1; cin >> age; cout <<"The age you entered is" << age return 0 }

Member Avatar for dodo rawash
1
171
Member Avatar for burcin erek

distance does not name type mistake even though I suppose that I am right. pls help [CODE]#include <cstdlib> #include <iostream> #include <conio.h> #include <sstream> // struct unit with loop inside.... using namespace std; struct distance { int mt; float cm; }; struct room { distance length; distance width; }; int …

Member Avatar for burcin_erek
0
99
Member Avatar for jmcorpse

I think there may be a math error in my program and I may not be seeing it. Is it possible for someone to go over it just to make sure it is ok. I have done everything I could think of to try to fix it, but it is …

Member Avatar for Kanoisa
0
120
Member Avatar for avataralien

I am trying to create a cpp file that will enable user to download the content from a web URL & stored it to a desired html file. I am running on Linux. The program will call GNU wget CLI program to grab the content & stored it to a …

Member Avatar for avataralien
0
189
Member Avatar for silvertooth07

i'm having problems with the edit function on my program. when i enter something, it crashes. it prints out "File not found" endlessly. [code] #include<iostream.h> #include<fstream.h> #include<conio.h> void info() { cout << " **********************************************" << endl; cout << " * Case Study - 2 *" << endl; cout << " …

Member Avatar for silvertooth07
0
142
Member Avatar for deepak_1706

I've just started programming in c#, its a simple Forms application with single form. I have a class written in a separate .cs file in its own namespace. The rest of the code is in the Form1.cs file. I am able to create an instance of the my class and …

Member Avatar for deepak_1706
0
684
Member Avatar for Zege

Hello, I am working on a project for school, and the professor and I got cut short while he was explaining this to me. I am hoping I can get some advice on what to do next... here are the directions he posted: [B]Have your compressor class read in bytes, …

0
37
Member Avatar for cortez716

I'm trying to write a function called (sumTo) that takes as [B][U]arguments two integers[/U][/B]. My function should use a loop to sum all of the numbers between the two (This includes the starting and ending numbers) and return the sum. I want the function to allow for either argument to …

Member Avatar for cortez716
0
186
Member Avatar for Orion2k

well first of all I ask u people don't try to give me advices like use QT instead that waste my time lot I want a direct answer how to do this cause this is really important C++ Module in my college has just started well the whole yesterday night …

Member Avatar for Ancient Dragon
-1
153
Member Avatar for 4221dave

I'm having some trouble, I'm using Dev C++ and I want to make my exe file and my dll file into one. So if i use my exe on another computer it tells me it's missing "libmySQL.dll" So I don't have to have two files. My current code is: [CODE]#include …

Member Avatar for sfuo
0
122
Member Avatar for OneRunner

So, first off lemme explain what a substitution code is in case you don't know. In cryptography, it's a system by which one letter is replaced with another predetermined letter. For example, if "I" turns to "E", and "F" turns to "V", the word "If" would be written as "Ev". …

Member Avatar for OneRunner
0
175
Member Avatar for ekailan

I am trying to convert char to wchar , but its not working !!the else case always executed in this code [CODE] char p[500]; while(getline(inFile1, line)) { //we read p from file that contain only one word "why"............for testing strcpy_s(p, 500, line.c_str()); string search = p; const size_t newsize = …

Member Avatar for ekailan
0
280
Member Avatar for vello

[CODE]#include <iostream> #include <fstream> using namespace std; char a[11][11]; bool free(int x, int y) { if (x < 1 && x > 10) { return false; } if (y < 1 && y > 10) { return false; } for (int i = -1; i < 1; i++) { for …

Member Avatar for Lerner
0
206
Member Avatar for Duece_68

Hey can anyone explain the following code to me [CODE = C++] #define SQUARED(x) {x * x} int main() { int i = SQUARED(3 + 2); return 0; } [/CODE] Why does 'i' in the above code = 11 and not 25????

Member Avatar for arkoenig
0
151
Member Avatar for Orion2k

what are the advantages and disadvantages of these two. I know MFC is an old outdated technology but still people use MFC and OWL ,the main reason OWL is good over MFC ,it produces smaller GUI executable and don't need .NET framework and and lower level compare with Wxwidget and …

0
67
Member Avatar for Martje

Hi all, I was following a tutorial on how to make .dll's since this is my first time making 1 but when i went to build the .dll i got an error saying : [QUOTE]definition of dllimport function not allowed[/QUOTE] my header and source is simple : Header.h : [CODE]#ifndef …

0
56
Member Avatar for helpfullProgram

Hello everybody! This is an amazing place you have built up here and I have never ceased to be amazed by the knowledge available... I have just one question which might seem quite easy to the right person so here goes. I am working with the console in C++ so …

Member Avatar for SgtMe
0
198
Member Avatar for neil_mahaseth

Is there any difference between a sorted link list and an ordered link list? If there is any difference please show it by giving an example. Thanks

Member Avatar for Narue
0
201
Member Avatar for peterman.k

Hello all, So I am a college student learning c++ (planning to major in computer science). Just my luck, the computer science department using visual studio for their entry level classes, which I have been using with no issues for the last year via a VM; I can access the …

0
160
Member Avatar for xiansen

hey guys, i am to program a simple blackjack program that generates two random cards for the user and ask if the user wants to stay or hit it. so far, when i tried to compile the program, nothing showed up and showed me this message: "The program '[492] alt.exe: …

Member Avatar for xiansen
0
174
Member Avatar for behavet

how can i make program using arrays related to my course civil engineering?

Member Avatar for SgtMe
0
45
Member Avatar for behavet

how can i make program using arrays related to my course civil engineering? answer please?

Member Avatar for kes166
0
97
Member Avatar for anantk

I'm working on a soccer management program I had some other members of my group to compile data on 400 real life players into a text file. I planned on reading the text file using a program ,converting individual players into objects and then writing them to another file (in …

Member Avatar for anantk
0
131
Member Avatar for Rizwan606

does any one know how to Print the contents of the array on even index??

Member Avatar for Rizwan606
0
384
Member Avatar for dorien

I have a dummy question for you... I am trying to access a function from a class (Key) from another class (Music), but it gives the error: [CODE]‘thiskey’ was not declared in this scope[/CODE] So I guess the Key object thiskey is not public for this class. What I have …

Member Avatar for kes166
0
184
Member Avatar for jehdo

Objective This assignment has been designed so that you understand the concept of using dynamic memory allocation in C++. After the completion of this assignment you should have a good grasp on: o Array of Objects o Use of new Operator for dynamic memory allocation in C++, for user-defined types. …

Member Avatar for Fbody
0
604
Member Avatar for Ali ahmad
Member Avatar for peterman.k

Okay, so I have created and array of a maximum degree, which the user defines, and then inputs their own coefficients according to the size of the polynomial. For example, I ask for degree, they type 2, and then input 1,3 and 5 to create a polynomial: 1 + 3x …

Member Avatar for peterman.k
0
294
Member Avatar for omfgtom

So, this is the little compound interest program i wrote that is due tommorow. As far as I can tell it should be working, but it says something about an undefined reference? All help appreciated. [code]#include <cstdlib> #include <iostream> #include <cmath> #include <iomanip> using namespace std; int main(int argc, char …

Member Avatar for Valaraukar
0
115
Member Avatar for smithr3

Hi there. The problem that I'm experiencing here is quite a specific one, and after a few searches, I concluded that I ought to just ask. Tbh, I'm a little bit unsure what to search exactly! I have calculated earlier in my program various values in various arrays, angle[], t[], …

Member Avatar for Ancient Dragon
0
128
Member Avatar for ashishchoure

Hi, I am just trying to do some down casting. here is the code. [CODE] class Base { public: void virtual test() { cout << "Base Test"; } }; class Derived : public Base { int i; int j; public: void testD() { i = 8; j = 9; cout …

Member Avatar for Fbody
0
123
Member Avatar for Katana24

Hi, just started using Xcode to code C programs. Im trying to create multiple programs in the same source folder but Im getting an error message. When i select 'File' -> 'New File' -> '.C File' I can create the file fine: it creates the .c program and a header …

Member Avatar for creeps
0
217
Member Avatar for timb89

One aspect of comp science that really lets me down is loop invariants. A question from a past paper that i cant get is to find the loop invariant of the following segment of code: [CODE]bool linearSearchIter(int a[], int n, int target) { int i = 0; bool found = …

Member Avatar for Narue
0
152
Member Avatar for arkarjun

hai, i am developing a program which helps in reserving a ticket in railway. i am facing problem for the cancellation process. i had done all file operations (open,write..) in binary mode.... expecting a fast solution.......

Member Avatar for Fbody
-8
238
Member Avatar for jumpdlite

hey guys, I am supposed to write 3 boolean functions listed below. my problem is that I don't really understand the questions and don't know where to start. it would be really great if someone just do one of the functions to give me an example so i could finish …

Member Avatar for Stefano Mtangoo
0
174
Member Avatar for brontok214

write a c++ program that stores the following numbers in the array named miles:15,22,16,18,27,23, and 20. have your program copy the data stored in miles to another program named dist, and then display the values in the dist array. your program should use pointer rotation when copying and displaying array …

Member Avatar for Fbody
0
245
Member Avatar for kshaaban

does anyone know how to make a variable type to store GUIDS? I can currently read GUIDS however storing them is proving difficult. Ideally I would like to do this to compare them and organise them based on a variable type. I am a beginner however am eager to jump …

Member Avatar for kshaaban
0
221
Member Avatar for ekailan

I appreciate any help ........I treid many solution it did not work! [CODE]aTree.AddString(L"barak");[/CODE]//this is working 100% when I tried to do this : [CODE]char *p; p = new char[500]; //read the value of p from file one line at a time aTree.AddString(p);//not working [/CODE]

Member Avatar for ekailan
0
204
Member Avatar for Shijo Jose

I wish to do a program in c++ that enables me to play music as part of my school project. I want to know if is this is possible. I also wish to know if photos and other media can be similarly accessed and where i can get information on …

Member Avatar for sachin.tendul
0
208
Member Avatar for arjen

print a list of integers from 1 to N that are both divisible by 2 and 3.and after producing the list, count the numbers of integers found.

Member Avatar for LevyDee
0
286
Member Avatar for ToiNKieZ

can somebody teach me or show me a code that converts a binary to a decimal.... >_< and if you could kindly explain how it happens.... should be in TurboC programming....

Member Avatar for stereomatching
0
148
Member Avatar for rtdunlap

I need to write a C++ code that will ask the user to enter either 1 or 2. If 1 is entered the program must count all even numbers from 0 to 100. (I got that part done) If 2 is entered you are suppose to prompt the user to …

Member Avatar for stereomatching
0
104
Member Avatar for burcin erek

5 student picked up 5 balls. they do not choose same number but during print out process, the program is writing different ball number i dont know why? [CODE]#include <cstdlib> #include <iostream> #include <conio.h> using namespace std; int main(int argc, char *argv[]) { int i; int ogr[5] = {0}; // …

Member Avatar for burcin erek
0
104
Member Avatar for keeda

Hi, I have to pass a void pointer in a function and at the other end I have to read some values from this void pointer. I planned of creating a class and setting up required variables into an object and then I set this [CODE] void* ptr = obj …

Member Avatar for keeda
0
99
Member Avatar for abhiab1991

1) Write a program to count the number of blank spaces in a given string. 2) Write a program to abbreviate a given string (e.g. if the input is Amar Akbar Anthony, the output will be AAA)

Member Avatar for abhiab1991
1
133
Member Avatar for kuchick32

I have an assignment where I'm taking a file from my computer and using the numbers to pull something out. I'm supposed to take numbers from a file and checking to see how many times the number is in the file. But i can't seem to figure it out. This …

0
86
Member Avatar for cortez716

This function should take as it's arguments two integer values. The function should return the smaller of the two values. From main ask the user for two integer values. Pass the two values to your smallest function, then print out the returned value. I am new to c++ and struggling …

Member Avatar for cortez716
0
154
Member Avatar for Duece_68

Hi I was just wondering if I create a pointer using the new operator and then I call the new operator on that same pointer later on would that overwrite the existing pointer so that I do not waste memory on the heap or do I have to delete it …

Member Avatar for Duece_68
0
133
Member Avatar for jmcorpse

I wrote this program about four hours ago and everything but my if loop is working. I wrote a separate one in a test file and it works, for the life of me I can't get it to work in this program. When inputting anything other than a y or …

Member Avatar for jmcorpse
0
126

The End.