51,593 Topics

Member Avatar for
Member Avatar for mirroredreality

Hi, Could someone please advise me on how to get the full path of a file in MS VC++ and Dev C++? And would anyone know how to open in new windows, files of different extensions like .jpg or something like that? Thanks in advance. :-D MirroredReality

Member Avatar for Ancient Dragon
0
104
Member Avatar for lalavoodoo15

I am trying to understand how [bool hasaletter(string, char(c))] works. after boolhasaletter appears, if it is true, i want to add to total_num. I have tried if(true) { and it did not work. so basically, im trying to see if a string has a character user inputted. [code=c++] int main() …

Member Avatar for Duoas
0
73
Member Avatar for freakybeavis

I'm new here and fairly new to c++. Not sure if this forum is exclusivly for students because I am not one, just learning it for fun. I read the "read me" on flushing the input stream but it seemed rather complicated. What's happening is if the correct color is …

Member Avatar for Duoas
0
2K
Member Avatar for tnvkrishna

hello, i have a header file (intl.h)which contains the declaration of members of class intl and the members functions are defined in 5 different headers and i have one more header (floatl.h) which contains the total declaration of class floatl and it's member functions the over view is something like …

Member Avatar for vijayan121
0
120
Member Avatar for lalavoodoo15

Hi, i am trying to make a program that gets words from a txt file (strings) and see if the words have the character the user has inputed before. for example... the program will ask the user to input a letter. ( the user inputs, lets say a letter 'k') …

Member Avatar for Ancient Dragon
0
106
Member Avatar for Flakester

I've ran into a problem :( Something is wrong between my functions. When I try to take 'num' from the main function and put it in the getFib() function, it turns into some crazy number, sometimes random. Why wont it stay the same number that was declared in main? Sorry …

Member Avatar for WaltP
0
119
Member Avatar for IzzoYourNizzo

[B]This is the problem.[/B] Reversing the elements of an array involves swapping the corresponding elements of the array: the first with the last, the second with the next to the last, and so on, all the way to the middle of the array. Given an array a , an int …

Member Avatar for WaltP
0
128
Member Avatar for helixkod

Heres the part of the code That i have: [CODE] #include <iostream> using namespace std; const int NUM_DIV = 6; //Number of divisions const int NUM_QTRS = 4; //Number of quarters void divisionSales(double [][NUM_QTRS], int); void divisionChange(double [][NUM_QTRS], int); void quarterSales(double [][NUM_QTRS], int); void quarterChange(double [][NUM_QTRS], int); int main() { …

Member Avatar for Ancient Dragon
0
328
Member Avatar for dblbac

i have made the following but the user should get 10 chances to guess the right number. after the 10 guesses or if the the guesser gets it correct it should ask if the player wants to play again and react accordingly. [code=cplusplus] #include <iostream> #include <cstdlib> #include <ctime> using …

Member Avatar for dblbac
0
156
Member Avatar for Shay_

Hi all, I have a very weird problem. I develop a game on Nintendo DS using DevKitPro. I have a method that get a value in an XML file : [code]sscanf(xEffect.getChildNode("mpmodif").getAttribute("value"), "%d", &mpModif);[/code] With the values I have get, I instanciate a new Effect : [code]Effect *test = new Effect(durationTime, …

Member Avatar for Salem
0
73
Member Avatar for agramma

hi , i must convert the following c code to mips assembly for my university: odd = 1020000; /* 0xF9060 */ j= 0; loop: if (j & 0x1) { printf(“odd\n”); odd++; } j = j + 1; if (j < 5) goto loop; printf(“%d\n”,odd); variables j and odd must be …

Member Avatar for Salem
0
51
Member Avatar for HLA91

Hi all My friend sent me this C++ program that opens up notepad and starts typing, its a joke he made to scare his little brother, I tried to modify it to display more of the message "Im watching you" but when I do it wont compile and I dont …

Member Avatar for HLA91
0
141
Member Avatar for picass0

i have a code for complex number but when i key in 7+i3 and 5+i2 into the operator+ it should return me the result of 12,5 but i receive 430. What is the problem wif my code? [code] class Complex { friend istream& operator>>(istream&, Complex&); friend ostream& operator<<(ostream&, const Complex&); …

Member Avatar for Narue
0
90
Member Avatar for vaishal

1. Create a file with the following data: No of students on file – type integer Then for each student Student ID Number-type long Student name- type integer[81] Total credits- integer Grade Point Average- float Sample data: 3 0558899 Roger, R. 12 3.8 5646489 Jack, J. 24 2.5 1641564 John, …

Member Avatar for Lerner
0
98
Member Avatar for c++ prog

i'm new to c++....i'm making a project here but i have a problem with this: reading values as type char and converting it to type int...such that 54 can be read as '5' and '4' but after that it will be read into type int...can anyone please tell me how?

Member Avatar for Narue
0
89
Member Avatar for m16jim

I have a question on an assignment that has me confused. The question is how many times does the following loop execute? For I = 1 to 10 PRINT I End For (I) Now I am not sure if this is a trick question or not. I do not see …

Member Avatar for Narue
0
124
Member Avatar for c++ prog

i'm new to c++....i'm making a project here but i have a problem with this: reading values as type char and converting it to type int...such that 54 can be read as '5' and '4' but after that it will be read into type int...can anyone please tell me how?

Member Avatar for Ancient Dragon
0
80
Member Avatar for jaepi

Hello there. Is there anyway that you can convert the '\n' in windows which is 2bytes to the '\n' 1byte so that the linux could read it?

Member Avatar for vijayan121
0
167
Member Avatar for nurulshidanoni

hello, why the output below produce number 0, eventhought there is no 0 in the array? [code=c++] #include <iostream> #include <conio.h> #include <cstdlib> #include <cmath> #include <cstdio> #include <ctime> using namespace std; int i; int x[7]; int A[7], B[7], C[7], D[7], E[7], F[7]; int Min( const int *A, const int …

Member Avatar for Nick Evan
0
159
Member Avatar for geekychick

can someone tell me why my getline statements aren't working correctly? My compliler seems to just skip over them in my functions... here's my code: #include <iostream> #include <string> using namespace std; void locate(string[],int&); void substitute(string[],int&); const int MAX_LINES=7; int main ( void ) { char command; int i,currentLine; string …

Member Avatar for geekychick
0
91
Member Avatar for helixkod

Heres the situation: I am taking a C++ course online. I had a PC up until about a week ago when i got a Mac. Now i must do all my work on the only computer i have, the Mac. I turn in my work at the end of the …

Member Avatar for vijayan121
0
177
Member Avatar for SurviBee

I'm using a class to generate a list of primes. Im checking a series of numbers being incremented by two against the current vector of primes to see if any primes divide into the number evenly. If no primes divide into it I add the number onto the end of …

Member Avatar for vijayan121
0
248
Member Avatar for jadedreality

I know this is simple, but I need a bit of help. I need to write a program that will prompt the user to enter three integers, and should then print the numbers in ascending order. The hint the teacher gave was to use scanf three times? I'm just confused...

Member Avatar for jadedreality
0
397
Member Avatar for mandsmom

Hi, I have never used a forum like this before but I am stuck! I have to write a C++ program that allows the user to enter up to 20 students info. It must include Nem, Exam 1 grade, exam 2 grade, Homework average, final exam average. For each student, …

Member Avatar for WaltP
0
230
Member Avatar for kodiak

Hi, I am an intermediate c++ programmer, and I'm looking for a tutorial on Visual C++ express edition. If anyone could point me in the right direction with a link (I've searched google, and just get loads of stuff from microsoft, or things that are irreleveant.), it would be help …

Member Avatar for Ancient Dragon
0
143
Member Avatar for gator6688

I need to assign each student a letter grade. The way I have it set up now it assigns the letter grade of the second student to both students. How can I get it to assign each student their own letter grade? Also, I would rather output the letter grade …

Member Avatar for gator6688
0
327
Member Avatar for Jacky1

Hi guys I'm doing a program for one of my class but the teacher asked us to write a language mangler to modfiy a sentence and make it nonsentence And he want us : - If any word has length 9 or more characters, insert into the word after the …

Member Avatar for Narue
0
101
Member Avatar for Alethea

heya... can any1 plz help me write this program. write a program that the user is converting from and to base, and also from value. thx

Member Avatar for Narue
0
136
Member Avatar for zandiago

Good day. My semester of c++ is coming to an end. I've got to complete a total of 7 assignments within the next 3 weeks. I've completed 5 out of the seven. I've got two left (1 has a separate thread by itself). So you can also take a look …

Member Avatar for Nick Evan
0
195
Member Avatar for dockuvn

Help me. My teacher force me make dll by C++ instead of VC or VB... I have searched anywhere and ask many people but I couldnt find out the way to do it. Please help me ASAP. Best regards

Member Avatar for Narue
0
25
Member Avatar for AXAsianXie

Hi can someone look at this program for me it wont fill out the whole address for me and when i search or go delete it doesn't do anything. [code=c++] #include<iostream.> #include <fstream> using namespace std; struct Person { char Name[50]; char Address[80]; char Phone[30]; }; void add(); void search(); …

0
68
Member Avatar for AXAsianXie

Hey i have a HW to do an address book storing the names addresses and phone #s and add to address.txt. and the phone is the key so i have to create a search using the phone #. i'm also suppose to use a mygetline function that i don't quite …

Member Avatar for Salem
0
121
Member Avatar for wjyeo

Hi i've have this problem in my code when i do the overloading of operator >>. My problem for this code isnt encounter error but my input like say i input 7, the num.a output will change this 7 to 55 and num.b output for 5 to 53. below is …

Member Avatar for wjyeo
0
299
Member Avatar for mank

I want to create two functions, one that takes array values and lenngth and the other displays array values and length Here is my code, it gives me segmentation fault [CODE]#include <iostream> #include <iomanip> using namespace std; void input_array(float a[], int &n) { int j; for (j=0; j<n; j++) { …

Member Avatar for Ancient Dragon
0
111
Member Avatar for disc

[code] class MyControl : public BaseControl { } class Base { proctected: BaseControl &mControl; } class MyClass : public Base { public: MyClass( MyControl &control ); void ReadControl(); } MyClass::MyClass( MyControl &control ) :Base(control) { } void MyClass::ReadControl( void ) { MyControl &control = (MyControl &)mControl; // <=== ??? control.DoSomething(); …

Member Avatar for disc
0
245
Member Avatar for amin3d

Hilbert is a game in which you control a robot on an infinite two‐dimensional grid. There are three commands available to you: • G: Go one square forward in the current direction. • L: Turn ninety degrees counterclockwise. • R: Turn ninety degrees clockwise. After playing this game for a …

Member Avatar for WaltP
0
59
Member Avatar for amin3d

Problem ::: Last night, I’d been invited to a party. After dinner, the host invited us to do a lottery game and gave each of his N guests (including me) a ticket. Each ticket was a white square piece of paper in which a positive number (with no leading zero) …

Member Avatar for WaltP
0
97
Member Avatar for noobyjoe

Hi There, It is my first post. I am currently workign for a company and have just been moved into R+D. Part of my new job involves C++ Programming. I am having trouble with numerous things, (was thrown in the deepend) Basically, This program is designed to keep track of …

Member Avatar for noobyjoe
0
166
Member Avatar for tnvkrishna

title was self explanatory.. i repeat .. can a class allow a friend method of a friend class to use it's protected or private members oh yes one more, can a friend method of a derived class use base class's protected members i am new to this type of concept …

Member Avatar for vijayan121
0
113
Member Avatar for ArrogantLegend

Create a text file with a letter on the first line, and two double-digit numbers on the second line. Write a program using fstream that reads in your text file, creates variables to manipulate that input and outputs the following results to a different text file: "The ASCII value of …

Member Avatar for Duoas
0
131
Member Avatar for bStiffler582

It's a phone book program. Takes number, name, and address and saves them to addressbook.txt. It has add, search and delete functions. I got all but delete. Here's the search function(works): [code=c++] void search(){ char num[50]; char search[50]; ifstream input; input.open("addressbook.txt"); cout << "Enter phone number: "; cin >> num; …

Member Avatar for bStiffler582
0
167
Member Avatar for Gadgetman_53

Hey, I'm still fairly new to C++, and even more new to this forum. Any help would be greatly appreciated. Could someone look at this segment of code for me and tell me what is wrong with the "if" statements to change the time. I'm not getting the output that …

Member Avatar for Gadgetman_53
0
876
Member Avatar for fhshockey05d

The ultimate goal is to send simple messages ("GH", "HC", etc.) to a CMUcam2 and to read what messages I get back. I need help in setting up a serial communications port in Windows. I have seen how to open the port on other threads on this website, but I …

Member Avatar for Ancient Dragon
0
201
Member Avatar for jaepi

I was advised by a friend of mine to use fread64, fwrite64 instead of fread and fwrite. Does this exist? Been looking for it's documentation but I haven't found one.

Member Avatar for jaepi
0
2K
Member Avatar for abarnett

I am to write a program that can be used to calculate the federal tax. The tax is calculated as follows: For single people, the standard exemption is $4,000; for married people, the standard exemption is $7,000. A person can also put up to 6% of his or her gross …

Member Avatar for WaltP
0
3K
Member Avatar for IAmCalledDave

Alright, so, I have this project in my advanced C++ class for which I have chosen to create a simple audio player (if i get that done, video is a possiblity) I have a GUI already laid out and Im using an embedded WMP as the process bar/start/stop/pause/next, all that …

Member Avatar for iamthwee
0
100
Member Avatar for danbellinger1

I have been trying to get this Binary to Decimal program to work. I'm sure I'm not doing this with the least amount of code, if you have suggestions (using modulus especially). The errors I used to get was binNum is too large for the "long" type. I then used …

Member Avatar for Narue
0
126
Member Avatar for danbellinger1

I am working on an assignment (I know many have asked but none have asked about the number of digits I need plus some) that is to accept input for the fibonacci corresponding to that (i.e. 0=0, 1=1, 2=1, ..., 96=51680708854858323072). When it gets to 79 (should be 14472334024676221 since …

Member Avatar for vmanes
0
189
Member Avatar for jaepi

Hello there, I'm currently encountering a strange error which is I don't know why or could this one be possible. I have several for loops inside a function and I used the iterator outside the said loop, but I do get this error which is kinda strange. [code] error: name …

Member Avatar for vijayan121
0
131
Member Avatar for Dee76

I'm having trouble with the (dynamic_cast<Truck*>(vptr[k])) -> DOTLicense() part. If my numOfVehicles = 1 it works fine, but if numOfVehicles > 1 I get core dump error. I can remove the dynamic_cast statement and it works for numOfVehicles > 1. Any help or advise on what I'm doing wrong is …

Member Avatar for vijayan121
0
653

The End.