49,761 Topics

Member Avatar for
Member Avatar for myz068u

Hello I am newbie to C++ and I am testing my first loop using a switch statement. I want the loop to run nonstop until the user quits the program. [CODE] #include <iostream> using namespace std; int main() { char answ; cout << "Yes or No(y/n)" << endl; cin >> …

Member Avatar for mrnutty
0
102
Member Avatar for Ace1.0.1.

Note - I'm still learning c++... so there could be better ways of coding this. Try not to introduce new concepts - this will only aid in confusing me more, but please be more than welcomed to tell that i'm using something incorrectly. [CODE]// Classes - Using class to design …

Member Avatar for mrnutty
0
1K
Member Avatar for lordvoldemort

How do I multiply two arrays? Assuming that the numbers in the arrays are all single digit integers, which makes the array a big integer. Now I want to multiply these two big integers formed from arrays and also at the same time display steps. Please don't use multidimensional arrays …

Member Avatar for mrnutty
0
462
Member Avatar for gregarion

Hey, i was reading up on find function and i came across this line. size_t find ( const char* s, size_t pos, size_t n ) const; Correct me if im wrong, but it basically allows us to search a string based on the information inside an array right? After searching …

Member Avatar for mrnutty
0
153
Member Avatar for jprogram

I have been trying to do this assignment for the past 4 days. I thought I was doing good but the functions seem to be screwing up. All the greater than and less than functions are messing up. Also the add and subtract functions are messed up. Any suggestions would …

Member Avatar for WaltP
0
116
Member Avatar for Atomika3000

i have a program that generates a grid of 20x20 using a 2d array, it then populates it by randomly generating 2 numbers as co-ordinates, and then filling it with either an 'x' or an 'o' it has a maximum of 5 x's and 100 o's. What i need it …

Member Avatar for Lerner
0
4K
Member Avatar for 3cats

I have never posted to a forum before. I am taking a beginning C++ prgmming class. I am getting the error "error C2181: illegal else without matching if " I have tried everything I can think of to fix it, I can't tell if its a syntax error (such as …

Member Avatar for 3cats
0
169
Member Avatar for Lukezzz

Hi, I have a .txt file named: myTextFile.txt on my hostingaccount that contains this string: "Hello" Now my hostingprovider says this: "Any file that you can access via your domain can be accessed through a Secure Socket Layer (SSL) connection as well." When I type this manually in the address …

Member Avatar for Lukezzz
0
137
Member Avatar for jjennings11

My program is to display a menu choice for the user, they will then pick one of the choices and the program will perform a calculation for the user. It contains four functions (menu, sum, power, and gcd) and it must contain reference parameters...i have most of the program, it …

Member Avatar for jjennings11
0
108
Member Avatar for AltF4me

I've got a constructor that sets some floats (x,y,z) and then I have a function called setXYZ. Now the constructor and the function do exactly the same thing. What's the best thing to do in this situation? Should I put the code in the function then call this from the …

Member Avatar for AltF4me
0
117
Member Avatar for tennis

I saw the following sentences from a book “A difference between a destructor and other member functions is that, if a regular member function has a body at the derived class, only the version at Derived class gets executed. Whereas in case of destructors, both derived as well as base …

Member Avatar for mrnutty
0
107
Member Avatar for adrian75

can anyone help me with this c++ program? its a little much but i would really appreciate it Project specifications: Create a 2-player game that utilizes the “a s d f” and “4 5 6 8” keys on your keyboard. It would be a modified rock, paper, and scissors game, …

Member Avatar for tonymuilenburg
0
381
Member Avatar for Ron_HL

there are some problems in my coding which showing errors C2664 and C2562. i have no idea how to fix it...wish someone can point the problems and solutions too... [CODE]#include <iostream> using namespace std; const int listSize = 10; void fillArray(int list[],int listSize); void largest(const int list[],int listSize); void printArray …

Member Avatar for Salem
0
91
Member Avatar for summey

[CODE] #include <iostream> #include <string> #include <iomanip> using namespace std; // //CLASS DECLARATION SECTION // class EmployeeClass { public: void ImplementCalculations(string EmployeeName, int hours, double wage); void DisplayEmployInformation(void); void Addsomethingup(void); string EmployeeName; int hours , overtime_hours, iTotal_hours, iTotal_OvertimeHours; double wage, basepay; double overtime_pay, overtime_extra; double iTotal_salaries, iIndividualSalary; }; int main() …

Member Avatar for summey
0
101
Member Avatar for sana zafar

Hi I am attempting to write a code that will input the name of a file and output the number of times each letter appears in the file, and it is case-insensitive.For example : a|A : 5 b|B : 3 c|C : 0 d|D : 7 e|E : 0 so …

Member Avatar for Freaky_Chris
0
247
Member Avatar for vbx_wx

can anyone point what is wrong with my RegQuerryEx() function? Altough it return 0 :| [CODE] char buff[3] = {0}; DWORD size = sizeof(buff); DWORD type; if(RegOpenKeyEx(HKEY_CURRENT_USER , "Software\\vBx" , 0 , KEY_QUERY_VALUE , &hkey) == ERROR_SUCCESS) { if(RegQueryValueEx(hkey , "log" , NULL , &type , (LPBYTE)buff , &size) == …

Member Avatar for vbx_wx
0
92
Member Avatar for gregarion

Hey guys, i am having a huge problem checking the data i input to make sure it is correct. What i am trying to achieve is when i input a value, it will check if the input is all digits and if it is not, check to see if it …

Member Avatar for mrnutty
0
91
Member Avatar for dmr215

I am kind of new to c++, i usually code in java and php. This is a program that is supposed to read in an input file with very strict syntax that will either create a new stack/queue (implemented subclasses of simpleList), or push a value onto one of those …

Member Avatar for tintin.iitk
0
161
Member Avatar for n.utiu

I have been recently experimenting with Python embedding, but I stumbled across some problems. [CODE]#include <python3.1/Python.h> int main (void) { Py_Initialize (); PyRun_SimpleString("print (\"Hello World\")"); Py_Finalize (); return 0; } [/CODE] As you see it is not the most complicated code :). I have compiled in Code::Blocks using g++. I …

Member Avatar for n.utiu
0
718
Member Avatar for gregarion

Hey guys, i was looking through the internet for ways on how to solve converting roman numerals into integers and i found this method which is confusing me as im not able to understand it. [CODE]using namespace std; int main() { char rom; int n = 0; int tot = …

Member Avatar for gregarion
0
106
Member Avatar for tikoti

Hi all, I've been working with C semaphores for a while using shared memory (ftok, semget, semop, semctl) and it works perfectly. However, I was wondering wether using these structures all processes are protected against starvation. I have made several tests with nearly 200 processes sharing a binary semaphore and …

Member Avatar for tikoti
0
83
Member Avatar for DawnDenise

Volunteer C++ Gurus. Thank you in advance for your time. This site has saved my sanity. I am working with my longWords function and cannot get it to stop displaying the same value (2293264). I know that my code is a little janky because I modified it from array format …

Member Avatar for mattjbond
0
156
Member Avatar for hao90

sorry that i don't know i post on a correct place or not..=D my question is: How can i use the adjacency matrix like A B A 0 1 B 1 0 and write it to form of adjacency list like A -> B B -> A Hope you all …

Member Avatar for hao90
0
95
Member Avatar for Anarionist

I'm trying my best to learn linked lists but am having a difficult time understanding them exactly any way debugger returns SIGSEGV Debug Info: [code] Registered new type: STL String Registered new type: STL Vector Setting breakpoints Debugger name and version: GNU gdb 6.7.50.20071127 Child process PID: 1572 Program received …

Member Avatar for Anarionist
0
85
Member Avatar for ankit894u

[CODE]#include <cstdlib> #include <iostream> #include <string> #include <fstream> #include <sstream> #include <cstring> using namespace std; int main(int argc, char *argv[]) { fstream filestr; for (int i=1; i<=17771;i++) filestr.open ("mv_0000001.txt", fstream::in | fstream::out | fstream::app); filestr.close(); system("PAUSE"); return EXIT_SUCCESS; }[/CODE] guys i m trying to create multiple text files to the …

Member Avatar for ankit894u
0
270
Member Avatar for George2

Hello everyone, Are there any approaches to invoke Java libraries from C/C++? Thanks in advance, George

Member Avatar for hasrule
0
529
Member Avatar for rickster11

If anyone can take a second to view my code, I would really appreciate it. I've been working on this for days. I think I am so so close. Its the Knights Tour (Knight must move to every spot on board without moving to one spot twice). It breaks when …

Member Avatar for rickster11
0
174
Member Avatar for acos.carlos

Hi. So i have to do the program where we read from a file a certain amount of numbers(not more than 100), and then perform either a bubble or selection sort and a linear or binary search. I wrote the thing down and it read fine, but I can't get …

Member Avatar for WaltP
0
120
Member Avatar for jprogram

Ok, so I have some code from my HugeInteger problem again. Like the title says this is totally backwards. I keep getting the exact wrong result than what should be given. I could probably sneek by the graders with it, but now it is really got me wondering. When I …

Member Avatar for WaltP
0
93
Member Avatar for sportsguy90

Hey all. I'm having trouble developing an order program. Basically I have to compare two files, and validate that one equals the other. I have figured out how to determine whether the order data is valid or not, but i'm unsure how to go about writing out which pieces of …

Member Avatar for WaltP
0
129

The End.