Is there more to this code?
WordByte vs Wordbyte
Type: Posts; User: Tropod
Is there more to this code?
WordByte vs Wordbyte
Hi,
I can't seem to understand why this is not working as expected. The output from the two "couts" are different. Can someone please explain why?
#include <iostream>
#include <vector>...
In this instance better solution would be to pass the variables, for example;
void fee(int &a, int &b, int &c) // note pass by reference not value.
{
a = 1;
b = 2;
c = 3;
}
Add your if statement as part of the for loop, or visa versa depending on what or the order your trying to test, making sure it is in same scope. You can do this with proper usage of braces.
Thank you everyone for response! Very helpful :biggrin:
So now have the following pseudo code;
class BASE
{
public:
BASE() { };
~BASE() { };
Thanks for the replies :)
What am I missing here?
Works with pointer, but not iterator?
class BASE
{
public:
Alrighty back to the drawing board then, I'm obviously missing something.
Thanks for the reply :).
Thanks for the reply.
How would one iterate through objects, given the following;
class UI : public OtherClass
{
public:
Hi,
Can't seem to get my head around templates enough to get something to work the way I want.
Essentially I'm trying to create a class member variable that can store other class objects.
...
Hi,
Just wondering if virtual control is possible for something like (mfc) CEdit control? ie same thing as virtual list control, except an edit (or similar, combobox edit?) control.
I'm looking...
hi,
I'm wanting to find out a way to display/convert a whole char array or string into int, such that their hex values are displayed & not characters. I know how to do this, but I'm wanting to...
is there anyway to do this without copying?
hi
thank you for the reply.
Problem I'm having is once I do following;
fHandle.open(lpszPathName, std::ios::out | std::ios::in | std::ios::binary);
std::stringstream ssbuffer;...
hi,
I've been toying with this & it doesn't seem to work.
std::vector<char> vbuffer(filesize);
fHandle.read(&vbuffer[0],filesize);
stringstream ssbuffer;...
The data is not records based, it varies between all different sorts of file types. And the large(er) file(s) where it crashes, is 700MB~ or so.
hi,
I'm trying to improve some file loading & have the following;
fHandle.seekg(0,std::ios::end); ////fHandle is fstream.
std::streampos length = fHandle.tellg();
...
That might be because %d is not used for char
printf - C++ Reference
cout is for output, so yeah.
get the number of letters in the file, or size/length of the string, store that in int & use that for a loop to print stars.
i.e.
int numberLetters = filename.size();
for(int i = 0;...
I always find stuff like this article interesting to read, even if it is way over my head :eek:
The concept sounds good though.
...indentation could do with improving.
You need to check the path/execution of your code. Looks like it is never able to reach
while (num2==-1);
which is why it can't exit.
Thanks for the reply!
Was a little stuck but managed to figure it out from your post.
vector<int> iVec(*iListArray,*iListArray+sizeof(iListArray) / sizeof(int));
How would one...
hi,
I've recently changed some code in my program from a multidimensional array to a vector, and I'm wondering if/how it's possible to initialise a vector array.
i.e.
vector<int> MyVector;...
So wait, now I'm (really) confused :confused:.......
I currently have wxDevC++ 7.2.0.2 installed, with this issue. I also have another separate program/compile issue that I'm trying to deal with...
I realise that I can initialise/set the POINTS that way. I was trying to understand why the book I was reading & another (old) thread I came across, specifically had it laid out like this, but wasn't...