No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
10 Posted Topics
Hi!. I am having some problems with functions scopes again. I need to use one array initialized in one function, in a different function. I have searched on how to pass the array by reference or value ( and I truly don't know if that's what I need) but I …
A solution is to instead of separating each word with comas do it with spaces. Then read each line, and store the information in each variable. The compare the barcode[21] with lav32. If it matches display the rest of the information (thats what you wanna do right?). Might not be …
So I am trying to use multiple source files for my text based game. In Code::Blocks in doesn't even compile it says " cannot find -lfunctions.h". In Dev-C++ it compiles but the function doesn't work properly Here is the code Main.cpp [CODE]#include <iostream> #include <string> #include <fstream> #include "functions.h" using …
Hi! I have two questions about functions. First how can I use a main() local variable in a function outside of main? And how can I use a variable in the function paramaters which already has stored information (stored in main() ), and not have to give it new information …
I think that your code is very good, I doubt it could be simpler. One correction is that you shouldn't use the system function, instead use cin.get(): Here I modified your code for the loop: [CODE]#include<iostream> using namespace std; int main() { double b = 2.88; double h = 2.4; …
Instead of using fstream for reading and writing, why don't you use ofstream and ifstream depending on the process and see how that goes? Also you should post the new code
Just looking at the code quickly I can see a couple of bracket errors. Every if statements need brackets. Google for an if statement tutorial. For example: [CODE]if (guess < number) cout << "Too low, try again!" << endl;[/CODE] Should be: [CODE]if (guess < number) { cout << "Too low, …
So here is how the program should work: It should accept a string in which there is a full operation (ex. 23 + 34) it should split the string into three parts. The first and the third part should be the numbers and the second should be the operation sign. …
I was wondering. Is there any function like strtok to split into tokens a string, which is c++ standard? Also is there a way to store those tokens into separate char arrays? Thank You
The End.
AssaultM16