- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 7
- Posts with Upvotes
- 7
- Upvoting Members
- 6
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
Re:
Here is a simple program which gives me unexpected results: [code=c]int main() { printf("\nTo calculate a^b, enter value a now.\n"); int a = getchar() - '0'; printf("\nEnter b now.\n"); int b = getchar() - '0'; printf("a = %d, b = %d\n\n", a, b); return 0; }[/code] if i hit a … |
|
Re:
Hi there, I'm having trouble dealing with dynamic arrays and was wondering if someone could tell me where the problem lies. I'm new to C++. Basically, in the following code, the dynamic array of Fuzzy objects works fine. But when you uncomment out the bit that actually assigns values to … |
|
Re:
hey guys i just want to ask for your help about the source code of ROCK PAPER SCISSORS game on c++, the rules of the game is that, the user and the computer will battle, the game consist of 5 rounds ONLY,and first player who score 3 out of 5 … |
|
Re:
problem: a list represented using cursor based implementation contains all ACT, BSCS, BSICT, BSIT and BSMATH students. A dictionary is created implemented using open hashing for BSCS and BSIT students. Each grouping the dictionary is a list implemented using cursor based. given below is the definition of the LIST, Dictionary, … |
|
Re:
I have been advised by many people that it is better to use integer return type for main function instead of void ! I actually dont understand what return 0 means .. main returns 0 value to program ! What does that mean ?! Could you please help me understand … |
|
Re:
How to delete array elements by using it's subscripts in C language? |
|
Re:
Hi, Please help me spot where I go wrong. I cannot understand why the error. The Code with error and full error are below. Thanks Error:[COLOR="Red"] loaddll.cpp:6: error: invalid conversion from 'void*' to 'void (*)(wxString)'[/COLOR] lines 5, 6 and 7 [CODE=C++]typedef void (*helloSteve)(wxString);//takes string and Shows it! helloSteve myFunc = … |
|
Re:
if i have two strings say: string str1,str2; then how can i compare them by using strcmp function? |
|
Re:
i am using window 7 .in window 7 tubo c++ does not support full screen mode .i want to use the graphics functions of turbo c.i am unable to use graphics in turbo cin window 7.so please anyone tell me the solution. |
|
Re:
the following is the code... #include<iostream> #include<iomanip> using namespace std; int main() { float start_temp,stop_temp; float step,F,C; cout<<"start temperature:"; cin>>start_temp; cout<<"stop temperature:"; cin>>stop_temp; cout<<"step temperature:"; cin>>step; float i=0; cout<<setw(10)<<"celsius"<<setw(15)<<"fahrenheit"<<endl; cout<<setw(25)<<"celsius"<<setw(15)<<"fahrenheit"<<endl; for(i=start_temp;i<=stop_temp;i=i+step) { C=(5.0/9.0)*(i-32); F=32+(9.0/5.0)*i; cout<<setprecision(2); cout.setf(ios::fixed); cout<<setw(10)<<C<<setw(10)<<i<<setw(10)<<F<<endl; } } and the output for the above code is: start temperature: 0 … |
|
Re:
hello can you help me please,my problem is that i don't know how to format numbers when the user input this 1500 it should display 1,500.00 and having total paid 3,080.00 please help me hoping for your positive responds...thank you in advance... |
|
Re:
hi i am trying to use setw with a string.. here is my code.. [CODE]string a="hello"; cout<<setw(10)<<a;[/CODE] i inserted string header and iomanip header files... now my output should be with a few number of blank spaces and then it should print hello.. but its not working for me... could … |
|
This function reformats a numeric sequence to include grouping in the usual human readable format. "123456789" becomes "123,456,789", for example. The formatting is localized to the current running machine. In a German locale the previous example becomes "123.456.789". In a Hindi locale it becomes "12,34,56,789". Printing numbers for human consumption … |
|
Re:
Hi. I am trying to create a look up table in C. I have attempted it, but there are compilation errors occurring. Can anyone tell me what i'm doing wrong/offer any advice? I have in my header file the following: [code] struct { (void)(*function)(); const char* functionName; } lookUpTable[] = … |
|
Re:
Hi guys, I've to develop a software to compress and extract files using the RLE algorithm. And I've decided to implement it so that if I've a set of chars like "ABRTTTTOPSSSSSNU" it will be converted as "ABR4*TP5*SNU". Now, the problem is that for example the char '*' could be … |
|
Re:
Here is a very simple code demonstrating how 'protected' is used [CODE]# include <iostream> using namespace std; class A { protected : int a; }; class B : public A { public : void f_1() // * { a = 10; cout << a; } }; int main() { B … |
|
Re:
So, due to my last question, [url]http://www.daniweb.com/forums/thread303487.html[/url], I am becoming acquainted with the vector template. However, I clearly am not using the commands correctly. Below is a section of code which, eventually, leads to a segmentation fault later in the program. First an introduction of the variables: [CODE] using namespace … |
|
Re:
Hello everyone, I'm having problems with this code: [CODE=cpp] #include <vector> using namespace std; template <class Type> class Some { private: vector<Type> elements; vector<Type>::size_type index; //THIS IS WRONG public: Some() { } }; int main() { } [/CODE] It doesn't compile, giving me [CODE] p.cpp:9: error: type ‘std::vector<Type, std::allocator<_Tp1> >’ … |
|
Re:
Hi, I am trying to incorporate a struct and class in the same program to calculate overtime pay and hours for one person. I am having a hard time with these two and especially putting them together. I am not sure what to do to get the program to compile … |
|
Re:
I have a problem casting a long to an int in c++ There is a long "biWidth" in the &pVideoInfoHeader->bmiHeader struct, I simply want to read this into an integer value "Width" [CODE=c]//check the video info header Width=(int)(&pVideoInfoHeader->bmiHeader.biWidth); Height=(int)(&pVideoInfoHeader->bmiHeader.biHeight); //break point here [/CODE] When I step through the code to … |
|
Re:
I have the line [code=c++]#include <algorithm>[/code] at the top of a file, and the line [code=c++]nth_element(minRollArray,minRollArray+n,minRollArray+numSets);[/code] in one of the fuctions in that file. However, when I try to compile it I get the error error C3861: 'nth_element': identifier not found at that line. I would expect this if I … |
|
What are good name conventions for classes. How for example should the name be different between a base class and a derived class or an abstract class and a concrete class? |
|
Re:
I was assigned to write a program that will verify a password entered by the user. The program should verify that the password has 6-10 characters and atleast 1 uppercase, 1 lowercase, and 1 numeric digit. The program runs, but will only display the length of the password entered and … |
|
What are some good exercises for an experienced programmer new to C++? I have found lists and suggestions on the web, but they are always simple or I have already completed them in other programming languages like C or Basic. Something that will help with learning modern C++ is best. |
|
Re:
Hi there, I'm in the process of moving some code into Visual C++ 2008, the code works fine when compiled with Mingw however crashes when compiled with VC++: [CODE=c++] s_cell **cell; *cell = (s_cell *) malloc(sizeof(s_cell) * MAP_X); for(int loop = 0; loop < MAP_X; loop++) { cell[loop] = (s_cell … |
|
Re:
I have had horrible experiences with this forum, but I'm going to give it another go. What is the point of learning C++? I am only a beginner but what is the point? You learn all of C++, then what... you can make a console program whopee! I mean, when … |
|
Re:
Okay. I created a program to create a character, and it uses a random number generator to initialize the Character classes strength and dexterity. Here's the character class constructor. Since the random number generator is based on time, both strength and dexterity have the same value when they're initialized. Is … |
|
Re:
Well I'mm 14 years old and I'm very interested in learning some programing languages like c++ and so on . I don't know were to start at , or what to do i have no money to go buy books to learn , if any one could point me on … |
|
Re:
I am supposed to write a food menu program for this one summer class an i have been trying for the past 2 hours to figure it out. Directions: Write a program which allows the user to choose a beverage, sandwich and side order from a menu. After the choices … |
|
Re:
I am trying to write my own shell. I am having problems with the user input part. I have made an array (char inputBuff[512]) and I want to read in user input. I am using ffputs() and ffgets() but I want to limit the person to the 512 size, and … |