49,761 Topics
| |
I have viewed some source that contained an identifier with a scope operator preceding it. Ex: [code=c++] ::var[/code] What does that mean/do? | |
i need help making an add function for an array. i know how to initialize it and have it started. when i add content into the array, i need to add it as a linked list. i have my function for the linked list completed alrady. if anyone can help … | |
Seeing we can do it with structs, why do we need classes? See the code and quote from [URL="http://publib.boulder.ibm.com/infocenter/comphelp/v8v101/index.jsp?topic=/com.ibm.xlcpp8a.doc/language/ref/cplr054.htm"]Link[/URL] [QUOTE="IBM Developer"]The C++ class is an extension of the C language structure. Because the only difference between a structure and a class is that structure members have public access by default … | |
[code] #include <iostream> #include <cstring> void rev(const char* str) { char* p = new char[strlen(str) + 1]; for(int i = 0; str[i] != '\0'; i++) { p[i] = str[strlen(str) - i]; } p[strlen(p) + 1] = '\0'; std::cout << p; } int main() { const char* s = "vBx"; rev(s); … | |
does anyone know how the binary information in a video file works... i found the file signature... but i pulled one character off after the file signature and it did not do what i thought it would... my code works fine... i just dont understand whats in the binary of … | |
Hi, I'm a newbie to C++ so please be patient. I have to create program that outputs a simple moire pattern or a graph of y-values from a .csv file depending on which one is called. The code below is what I have before main and is where I am … | |
I got run-time error for the following code. I am just starting to get familiar with linked list. Can any one point out what's the problem here? thanks [CODE] #include "stdafx.h" #include<iostream> using namespace std; struct node { int data; node * next; }; node* buildonetwothree() { node* head=NULL; node* … | |
Hi there! I need help with my assignment. The point if it is to make an array table that will hold various linked lists that hold other items. I already have my code to add and retrieve information from a linked list. I need help making an array that will … | |
Hi, I am kind of new to C++ and really stuck with a problem. Here I am trying to parse a string and after comparing to a pre-declared array save the tokens in a vector of vectors. It is giving a number of errors and I'm not sure what to … | |
hello i am having a little problem, I cant convert a double to one decimal place: here is my code [code=c]for(int i=0; i<marklist.size();i++) { double result=floor((marklist.at(i) /maxmark)); cout<< result<<endl; } [/code] I want result to be one decimal place | |
Hello, I am supposed to write a statement for a Codelab review test that asks: [I]"Given that two int variables, total and amount, have been declared, write a loop that reads integers into amount and adds all the non-negative values into total. The loop terminates when a value less than … | |
I am writing a model economy in which corporations (class BCorp) and persons (class BPrsn) act as agents buying and selling goods and services. I have a pool of contacts (class BContact) in which contact information is retained about each contact between agents. In a contact object I store a … | |
plz help me 2 finish my c++ proj on supermarket.i need the exact details of the funcns,sub calculatns............. urgent | |
I was trying to make a for loop count down backwards using this loop, but when it gets to zero, instead of realizing that decrementing will bring the number below zero, it tries to make the unsigned short (-1), which is actually 65535 as unsigned. of course, this code produces … | |
One of my assignments is to write a factorial function. I have no clue how to start this program. HELP!! This is my assignment.. Example Outputs Enter the number: 5 The factorial of 5 is 120 Enter the number: 0 The factorial of 0 is 1 Enter the number: -8 … | |
I have a problem, I want to create a program in C++. A simple program displaying all even number between 1 and 100, (such as 2, 4, 6, 8 etc.) in an out put. Can you tell me what wrong. Something like this. #include <iostream.h> int main() { int num1=1; … | |
Hi all!!! Could any one help me??? I want to build curve with C++ 6.0, but I don't know how to begin. I've been learned more about this case and the general problem is about header file "graphics.h". It is right?? Please help me!!! thanks a lot.... | |
I have a text file that I am reading into my program. The data looks as follows: Last Name, First Name, Current Salary, Raise Percentage iller Andrew 65789.87 5 Green Sheila 75892.56 6 Sethi Amit 74900.50 6.1 Ge Robert 81990.23 3.3 Smith David 43221.33 5.5 Jones Mary 33345.12 2.3 Goodman … | |
I'm supposed to write a program in C++ to show someone a grade criteria. I need some major help with it! I'm so so so confused! :( here is my assignment. please help me! A >= 90 B >= 80 C >= 70 D >= 60 F < 60 The … | |
can we make the maze game using header files of conio.h and iostream.h | |
Firstly i know your gonna say "OMG this guy just want to make his homework using our help" "Wow, this guy is so stupid not knowing this" Yes, i dont know this.. and yes this is my homework.. i'm not asking a direct answer atleast just teach me while pointing … | |
Here I have another one: The program that should first read in two values from the keyboard, a starting value and an ending value. It should sum all the even numbers between those two values including the endpoints and display the sum. If the ending point is less than the … | |
a 'challenge' question by my teacher asks me to look in my C++ book, and do a question. it asks me to: write a function powfun() and make it raise an integer number passed to it to a positive integer power and returns the result to the calling function. it … | |
Hello again everyone, How are you all doing? I am an fairly familiar with C/C++. I have five books on my shelf about programming in C/C++ but none could provide me with a satisfactory solution to this one problem. I would like to graduate from the Hello World project in … | |
| I just finished writing a string class that includes functions for generating random string (why I don't know, as I have never really needed random strings before). Basically the user can pass the function an enum citing what kind of string that'd like (i.e. AllUpperCase or AllNumeric). There is also … |
I trying to read in from a file but getting runtime errors can some one help find the .txt file as an attachment [CODE]#include<iostream> #include<set> #include<stack> #include<queue> #include<algorithm> #include<fstream> using namespace std; int main() { const int size= 7; char input[size]; fstream nameFile; nameFile.open("words.txt"); if(!nameFile) { cout<<"error cannot open file"<<endl; … | |
Hello, So I am just starting to really use Make files in Linux, and I am getting the following error when I try to "make": c++ -c main.cxx In file included from main.cxx:2: LinkedList.h:39:26: error: LinkedList.cxx: No such file or directory make: *** [main.o] Error 1 Here is my make … | |
Hello all, I dont know if this is the right area but anyway Heres my situation: I have a software that updates 2 devices firmware's, the software communicates with the devices via Serial Cable(RS-232) , my problem is: I only have 1 serial(COM) port in my motherboard, and i need … | |
Hey guys, I am making a calculator. It has two "screens", one showing input and one showing output. When the equals button is pressed on the calculator, the calculation is shown on the output screen. I have come across this problem: Let's say I type into the input screen "10" … | |
Hi every body I want to write a program that get a char value and put it in the pointer array until the user reach to end of line. what is the problem with my code. my code: #include <iostream> using namespace std; int main(){ char str ; int lenght=1 … |
The End.