Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
pseudorandom name
May 6, 2007

They wanted to replace ().

Adbot
ADBOT LOVES YOU

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!
I was wondering if anybody here has played with OpenCL. I'm finding it to be extremely finicky to get started. I installed the AMD APP SDK, and started trying to use some samples online. Generally the calls there will just plain fail. I found the samples in the AMD SDK, and managed to one of those to compile and run. It ties in other projects in the example Visual Studio solution file, so I had a hell of a time using it in a different solution.

The syntax in the AMD APP SDK looks very different. Their examples are using a C++ model with namespaces and everything. It looks to be doing similar things to the C calls in all the other sample code I see around. I wondered if that's AMD's thing, or if that's a newer spec than a lot of stuff online. I had started to read some stuff through my Safari subscription, and all those examples don't directly relate to the stuff in the AMD SDK.

FamDav
Mar 29, 2008

Suspicious Dish posted:

Did they really not want to type = or?

If you use an equal sign, then it will create a temporary from the initialization list and then invoke a copy-constructor.

EDIT: This is wrong, in case anybody reads this and doesn't read the next few posts.

FamDav fucked around with this message at 10:23 on Dec 13, 2012

That Turkey Story
Mar 30, 2003

FamDav posted:

If you use an equal sign, then it will create a temporary from the initialization list and then invoke a copy-constructor.

That's not true. When you use "=" in initialization it's just syntactic sugar (this is standard, not even an optimization). The object will not be copied.

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
Right, and even if it weren't, "initialize this local from a temporary of the same type" is basically a universal optimization — it's trivial to implement and pervasive in applicability.

Now, assigning a local from a temporary still builds the temporary, and the compiler can't legally do anything about it (other than with as-if reasoning). That's an important intuition for any C++ programmer, and there's no surer way to embarrass yourself as a C++ interviewee than to not understand the difference (not that it should be fatal if don't claim experience with C++ — just that if you do, getting this stuff right is pretty critical).

Hughlander
May 11, 2005

rjmccall posted:

Right, and even if it weren't, "initialize this local from a temporary of the same type" is basically a universal optimization — it's trivial to implement and pervasive in applicability.

Now, assigning a local from a temporary still builds the temporary, and the compiler can't legally do anything about it (other than with as-if reasoning). That's an important intuition for any C++ programmer, and there's no surer way to embarrass yourself as a C++ interviewee than to not understand the difference (not that it should be fatal if don't claim experience with C++ — just that if you do, getting this stuff right is pretty critical).

When interviewing people for an engineering position, I always ask them to rate themselves on a scale of 1-10 with how well they know C++. Anytime someone self-rates themselves as a 9 or 10 I ask RVO questions. I hate people who self rate at 9 or 10 and are really at like a 6 or 7.

The Gripper
Sep 14, 2004
i am winner
I don't really like the "rate yourself from 1-10 questions" just from experience, I worked at a few places where if you rated yourself 6-7 you'd just be shitlisted, but if you rated yourself 9-10 you'd be asked obnoxious edge-case questions that make you look retarded (despite being the kind of questions where if it was an actual practical issue you'd refer to the spec/docs anyway).

Even for languages I'm proficient and efficient with (definitely not C++) I won't rate myself above an 8 ever just because I'm wary of the interviewer having one rear end in a top hat of a question up their sleeve.

Volte
Oct 4, 2004

woosh woosh

Hughlander posted:

When interviewing people for an engineering position, I always ask them to rate themselves on a scale of 1-10 with how well they know C++. Anytime someone self-rates themselves as a 9 or 10 I ask RVO questions. I hate people who self rate at 9 or 10 and are really at like a 6 or 7.
Yeah I hate people who say they are the wrong thing on a made-up scale.

roomforthetuna
Mar 22, 2005

I don't need to know anything about virii! My CUSTOM PROGRAM keeps me protected! It's not like they'll try to come in through the Internet or something!

The Gripper posted:

I don't really like the "rate yourself from 1-10 questions" just from experience, I worked at a few places where if you rated yourself 6-7 you'd just be shitlisted, but if you rated yourself 9-10 you'd be asked obnoxious edge-case questions that make you look retarded (despite being the kind of questions where if it was an actual practical issue you'd refer to the spec/docs anyway).
How does that play out if you answer "9" and then when asked obnoxious edge-case questions your answer is "I'd refer to the spec before doing anything with that in any practical case"?

I hate all interview questions for similar reasons. I got asked to write a bit of code to convert an unsigned integer to a decimal-representation string without using any of the printf/itoa sort of functions, so I wrote one that walked down from the maximum possible number of digits before writing out the present digits. The guy said I should have used 'log' rather than walking down the up to 10 digits it would take to get to the start of the number. gently caress off guy, first you're telling me I'm not supposed to use prepackaged functions to do the task and then you're telling me to use one that's barely appropriate to make the tiniest loving difference in a way that only makes the code more awkward, less readable, and slower?

(I just tried it, a million repetitions on a four digit number took 360ms with my version, 960ms with a version using log. sprintf also takes 360ms.)

But of course you can't tell an interviewer that their "correction" is rubbish, so what are you supposed to do here?

vvvv I went with "I'm pretty sure that way would be slower", and I didn't get the job, so yay. Though I suppose it's more likely that I didn't get it because I didn't really want it that much anyway, don't hide my feelings well, and probably insulted their whole business model or something too, I tend to do that.

roomforthetuna fucked around with this message at 16:48 on Dec 9, 2012

taqueso
Mar 8, 2004


:911:
:wookie: :thermidor: :wookie:
:dehumanize:

:pirate::hf::tinfoil:

Tell them their correction is rubbish. Because it is.

Hughlander
May 11, 2005

In my mind though the whole purpose of interviewing is not for the knowledge you know but the way that you think. It's like what Gripper/tuna said, in an actual real life example you'll use google and read the specs, write unit tests and have them run etc...

However, I like to have a fairly simple problem for them to solve then slowly mutate it into more and more complex issues to see how the candidate deal with that. Because that's poo poo that we put up with all the time. Requirements change, code that was straight forward needs more and more complex validation as edge cases pop-up.

At this point though I'm sorry for the derail.

The Gripper
Sep 14, 2004
i am winner
Pretty much. Most of the awful questions come from people that didn't think it up themselves anyway/don't have a solid programming background, so they treat answers to what amounts to a "creative problem" in a black and white way without much consideration.

(also apologies for the derail, and I wasn't suggesting RVO was one of these horrible questions since it's something that actually matters.)

Hughlander
May 11, 2005

The Gripper posted:

Pretty much. Most of the awful questions come from people that didn't think it up themselves anyway/don't have a solid programming background, so they treat answers to what amounts to a "creative problem" in a black and white way without much consideration.

(also apologies for the derail, and I wasn't suggesting RVO was one of these horrible questions since it's something that actually matters.)

That literally is my question, "What is RVO and why should you know about it?"

FamDav
Mar 29, 2008

That Turkey Story posted:

That's not true. When you use "=" in initialization it's just syntactic sugar (this is standard, not even an optimization). The object will not be copied.

Hughlander posted:

That literally is my question, "What is RVO and why should you know about it?"

Is it bad that I (obviously) didn't know that the equals sign was meaningless in copy-initialization but knew about RVO? I swear C++.

EDIT: Okay, I think I see where I was confused. I had assumed that "F f0 = {12}" would be equivalent to "F f0 = F{12}" when it's really equivalent to "F f0(12)", which seems different than copy initialization? That is, "F f0 = 12" is equivalent to "F f0(F(12))" is equivalent to "F f0 = F(12)" but not "F f0(12)". This is assuming no copy elision.

FamDav fucked around with this message at 22:02 on Dec 9, 2012

awesmoe
Nov 30, 2005

Pillbug

mobby_6kl posted:

Anyway, this is pretty much my first C++ project and...
code:
vector<int> v { 2, 3, 5, 7, 11, 13, 17 };
Error	1	error C2601: 'v' : local function definitions are illegal
Dammit Microsoft :negative:
Luckily, C arrays still exist.

What compiler are you using? I think you need vs2012 with the new CTP for that to work (or at least, for that syntax to work everywhere).

an skeleton
Apr 23, 2012

scowls @ u
So, my entire class' projects have been optionally c++/java, and, seeing as I've been trained in C++, that's what I've been using. Well, my teacher is giving the final projects in Java-specific terms, so I was wondering if anyone knows if this assignment

quote:

Your job is to write a method:
public int commonKeyValuePairs(HashMap<String,String> map1,
HashMap<String,String> map2) that is passed two objects of type HashMap<String,String> and returns the number of common key/value pairs between the two HashMaps.

is doable in C++ terms and how I should approach it?

FamDav
Mar 29, 2008

an skeleton posted:

So, my entire class' projects have been optionally c++/java, and, seeing as I've been trained in C++, that's what I've been using. Well, my teacher is giving the final projects in Java-specific terms, so I was wondering if anyone knows if this assignment


is doable in C++ terms and how I should approach it?

Yes. Think of how you would ideally want to solve the problem, then recognize that std::map let's you do that easily.

an skeleton
Apr 23, 2012

scowls @ u

FamDav posted:

Yes. Think of how you would ideally want to solve the problem, then recognize that std::map let's you do that easily.

ok, so there is a library (i think that's what it's called?) in c++ for that. cool, thanks.

xgalaxy
Jan 27, 2004
i write code

an skeleton posted:

ok, so there is a library (i think that's what it's called?) in c++ for that. cool, thanks.

std::map and and an intersect algorithm in <algorithm> will let you do this in a couple of lines of code. However, your teacher is probably looking for you to at least write the algorithm yourself, if not the map too.

nielsm
Jun 1, 2009



xgalaxy posted:

std::map and and an intersect algorithm in <algorithm> will let you do this in a couple of lines of code. However, your teacher is probably looking for you to at least write the algorithm yourself, if not the map too.

When the task set directly mentions HashMap<String,String> I assume the teacher intends them to use the HashMap class provided by the Java standard library, meaning that using a map class from the STL should be fine too. (Worth a note is that Java's HashMap is actually equivalent to STL's std::unordered_map, although it doesn't make a real difference here. Just use std::map since you don't create a dependency on C++11 or TR1 that way.)

Suran37
Feb 28, 2009
Ok, I have to do a cache simulation program in C++. We have never done C++ before and I am really confused on how to start. We have a simulation.cc file which holds the main. Then we have cache, set, and block which each have a .cc and .o file. I feel like I understand the concept of cache, but I have sat here staring at my screen for hours and literally have no idea how to start and my TA didn't know what to do either.

Like how do I make a block given a block size of 2 bytes or 4 bytes?

Suran37 fucked around with this message at 02:44 on Dec 10, 2012

an skeleton
Apr 23, 2012

scowls @ u
Yea, using the hashmap class or equivalent is ok, i just have to write the algorithm.

awesmoe
Nov 30, 2005

Pillbug

awesmoe posted:

What compiler are you using? I think you need vs2012 with the new CTP for that to work (or at least, for that syntax to work everywhere).

Turns out I'm wrong and this
C++ code:
    std::vector<int> v { 1, 2, 3, 4, 5};
fails using the November CTP compiler with
code:
1>problems.cpp(12): error C2440: 'initializing' : cannot convert from 'initializer-list' to 'std::vector<int,std::allocator<_Ty>>'
1>          with
1>          [
1>              _Ty=int
1>          ]
1>          No constructor could take the source type, or constructor overload resolution was ambiguous
1>
1>Build FAILED.
edit: vvv yes, that is exactly what it was telling me and I was not comprehending. What a bad programmer I am :smith:

awesmoe fucked around with this message at 06:00 on Dec 10, 2012

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
The compiler supports it, but the standard library hasn't been updated yet.

Praseodymi
Aug 26, 2010

If I create a 2d dynamic array with
code:
   
Pixel** picture = new Pixel*[w];
   for ( int i = 0; i<w; i++ ){
      picture[i]=new Pixel[h];
   }
is the correct way to delete it with
code:
for ( int i=0; i<w; i++){
   delete picture[i];
}
?

nielsm
Jun 1, 2009



No, you need to use delete[] picture[x]; because the value was allocated as an array.

However you shouldn't be allocating your picture that way at all. Allocate it as one large hunk of memory (with w*h elements) and use y*w+x type indexing into it.

Praseodymi
Aug 26, 2010

The non-contiguous memory issue did come up, but the course leader didn't say anything about that method of allocating it, or that anyone was doing it wrong, even though it affects another part of the assessment where we have to use pointer arithmetic. I can't be bothered to start rewriting everything this close to Christmas, so I'm just going to hope we won't get marks docked for it, but thanks for the info, it should make this a lot easier in future.

nielsm
Jun 1, 2009



You can still allocate one large block and then make an additional array with pointers into that block for each row (or column, if you want to index reverse of what's commonly used.)

C++ code:
Pixel *raw_data = new Pixel[w*h];
Pixel **rows = new Pixel*[h];
for (int y = 0; y < h; y++) {
  rows[y] = raw_data + w*y;
}
If you do that you only have two blocks of memory to free, since you only made two allocations, but you still get a "compatible interface" with your existing code.

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
To clarify nielsm's first reply, using your original allocation scheme, the correct way to delete it is:
C++ code:
for (int i=0; i<w; i++) {
   delete[] picture[i];
}
delete[] picture;
Basically, you need a delete for every new, and if it was allocated with new[], it needs to be deleted with delete[].

fankey
Aug 31, 2001

I've been playing with implementing some thread patterns I've used in the past with std::thread ( and VS2012 if that matters ). One pattern I use is a worker thread which is doing something periodically and also needs to be told when to stop. Is the following code correct usage of C++11?
C++ code:
#include <string>
#include <iostream>
#include <mutex>
#include <condition_variable>
#include <thread>

class worker_t
{
protected:
  std::mutex m;
  std::condition_variable d;
public:
  void die()
  {
    std::unique_lock<std::mutex> lock(m);
    d.notify_one();
  }
  void operator()()
  {
    int ix = 0;
    while(true)
    {
      std::cout << "working " << ix++ << std::endl;
      std::unique_lock<std::mutex> lock(m);
      if( d.wait_for(lock, std::chrono::seconds(1)) == std::cv_status::no_timeout )
      {
        return;
      }
    }
  }
};

int main(int argc, char* argv[])
{
  try
  {
    worker_t worker;
    // can't copy mutex so we pass in reference to worker
    std::thread th(std::ref(worker));
    std::cin.get();
    std::cout << "shutting down thread..." << std::endl;
    worker.die();
    th.join();
    std::cout << "thread dead!" << std::endl;
  }
  catch(const std::exception& ex)
  {
    std::cout << "ex is " << ex.what() << std::endl;
  }
	return 0;
}

b0lt
Apr 29, 2005

fankey posted:

I've been playing with implementing some thread patterns I've used in the past with std::thread ( and VS2012 if that matters ). One pattern I use is a worker thread which is doing something periodically and also needs to be told when to stop. Is the following code correct usage of C++11?

Unless what you mean by "working" is literally just waiting on a condition variable until told to stop, what you want is something along the lines of this:


C++ code:
#include <string>
#include <iostream>
#include <thread>
#include <atomic>
#include <chrono>

class worker_t
{
protected:
    std::atomic<bool> kill_yourself;
public:
    void die()
    {
        this->kill_yourself = true;
    }
    void operator()()
    {
        int ix = 0;
        while(!this->kill_yourself)
        {
            std::cout << "working " << ix++ << std::endl;
            std::this_thread::sleep_for(std::chrono::seconds(1));
        }
    }
};

int main(int argc, char* argv[])
{
    try
    {
        worker_t worker;
        // can't copy mutex so we pass in reference to worker
        std::thread th(std::ref(worker));
        std::cin.get();
        std::cout << "shutting down thread..." << std::endl;
        worker.die();
        th.join();
        std::cout << "thread dead!" << std::endl;
    }
    catch(const std::exception& ex)
    {
        std::cout << "ex is " << ex.what() << std::endl;
    }
    return 0;
}

roomforthetuna
Mar 22, 2005

I don't need to know anything about virii! My CUSTOM PROGRAM keeps me protected! It's not like they'll try to come in through the Internet or something!

b0lt posted:

Unless what you mean by "working" is literally just waiting on a condition variable until told to stop, what you want is something along the lines of this:
Well, he said "periodically" doing something, and his code was waiting for one second (or a 'die') then either doing stuff or exiting. So his way would work okay for what he said, I think. (Though some confusion about 'lock' being made twice, I don't think that's quite right, but there should be a mutex or signal or something that does what he wants.)

Whereas, if the 'period' was long, your way with the sleep would be more of a problem because the 'die' signal wouldn't be responded to until after the timeout.

roomforthetuna fucked around with this message at 03:45 on Dec 12, 2012

b0lt
Apr 29, 2005

roomforthetuna posted:

Well, he said "periodically" doing something, and his code was waiting for one second (or a 'die') then either doing stuff or exiting. So his way would work okay for what he said, I think. (Though some confusion about 'lock' being made twice, I don't think that's quite right, but there should be a mutex or signal or something that does what he wants.)

Whereas, if the 'period' was long, your way with the sleep would be more of a problem because the 'die' signal wouldn't be responded to until after the timeout.

The sleep is a stand-in for <do work>, what he had would not work if it does anything other than wait on the condition variable, because condition variables are not semaphores and notifying a condition variable that isn't being waited upon will not signal a future wait() call. The following code (which would be equivalent to what he had, if die() is called while the worker thread is working and not waiting on the condition variable) deadlocks:

C++ code:
#include <chrono>
#include <condition_variable>
#include <mutex>
#include <thread>

int main(void)
{
    std::condition_variable cv;
    std::mutex mutex;

    std::thread(
        [&cv, &mutex](void)
        {
            std::unique_lock< std::mutex > lock(mutex);
            cv.wait(lock);
            cv.notify_one();
        }).detach();

    std::this_thread::sleep_for(std::chrono::seconds(1));
    cv.notify_one();
    std::this_thread::sleep_for(std::chrono::seconds(1));

    std::unique_lock< std::mutex > lock(mutex);
    cv.wait(lock);
    /* Never reached */
}

fankey
Aug 31, 2001

b0lt posted:

notifying a condition variable that isn't being waited upon will not signal a future wait() call.
If that's the case then I understand the issue with my code. A slightly more concrete example would be a thread that monitors a piece of hardware and updates a GUI through some mechanism. I want the thread to poll the hardware once a second but exit as quickly as possible when it needs to shut down. Something like
code:
thread_func
  while true do
    get_hardware_status
    update_gui
    if wait_for_death_for_one_second then return
Normally I'd use Win32 Events for such things.

On a similar note, is there a way using std::thread stuff to wait on multiple things at once? Say my worker had a queue of jobs and when something was added to the queue I want to execute it immediately. I think I could just wait on my add_job condition_variable for x seconds and exit ( similar to what you originally posted ) but ideally I'd be able to wait on both the add_job and some sort of thread_death object so I can kill the thread as soon as possible. This sort of thing is important because my code runs in soft real time systems where I might need to shut down threads and relaunch within 30ms.

roomforthetuna
Mar 22, 2005

I don't need to know anything about virii! My CUSTOM PROGRAM keeps me protected! It's not like they'll try to come in through the Internet or something!

b0lt posted:

The sleep is a stand-in for <do work>, what he had would not work if it does anything other than wait on the condition variable, because condition variables are not semaphores and notifying a condition variable that isn't being waited upon will not signal a future wait() call. The following code (which would be equivalent to what he had, if die() is called while the worker thread is working and not waiting on the condition variable) deadlocks:
I'm not really following how that's equivalent, but I'm also not really up on std::thread stuff, I'm still more in POSIX thread mindset. Is this correct for the sequence of events in your code?
1. a thread is spawned, sharing mutex and cv.
2. the thread acquires a lock on the mutex.
3. the thread releases the lock and suspends until cv is notified. (meanwhile the original thread sleeps)
4. original thread notifies. spawned thread reacquires the lock.
5. original thread sleeps. spawned thread notifies.
6. original thread acquires a lock (do we block here because the lock is on the same mutex and the other thread still has a lock? Or is it okay because the other thread ended already?)
7. original thread waits for a notification that never comes because it arrived too early.

If I'm reading that right then fankey's original code shares the same problem, but wouldn't actually lock up when it occurs, it would just potentially fail to exit and keep running its "increment and output a variable" work if the timing of the 'die' call was unlucky, because the unmet "wait_for" would continue to time out.

And in that case it sounds like the actual question is "how do you implement a semaphore in C++11?" To which the answer appears to be "almost how fankey did, only with the addition of a 'count' that gets incremented after the lock but before the notify when you call 'die', that is checked after the lock in the thread but before the 'wait', and that is decremented either when the wait is aborted or the check was positive. I think that would achieve the "work and sleep" model fankey was asking for without the potential delay to death that b0lt's solution came with.

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!
You guys happen to be talking about some stuff that I was always hoping to find clarified anyways. I've had some situations in the past where I was using a condition variable, and a race condition where the waiter waits after the notifier notifies. So the waiter gets stuck. I had to set up more advanced criteria to make sure the waiter checked some variable indicating the notification already happened. I thought it was clumsy, and also that in some situations this didn't happen. For example, I could swear in .NET that monitors don't have this problem, but now I'm not sure.

Are you guys saying a semaphore is better for this kind of stuff? If I had to, say, just do a single notification--rather than looping on the condition variable or whatever--what is the most proper way to maintain that variable? I'm fearing that I have been screwing this up.

In Boost, I would provide a predicate function to test that boolean, and I would make the boolean volatile. I can't remember if I'd lock it first, but I know I should. I don't know if I'd need to make it volatile if it was locked. :(

b0lt
Apr 29, 2005

Rocko Bonaparte posted:

You guys happen to be talking about some stuff that I was always hoping to find clarified anyways. I've had some situations in the past where I was using a condition variable, and a race condition where the waiter waits after the notifier notifies. So the waiter gets stuck. I had to set up more advanced criteria to make sure the waiter checked some variable indicating the notification already happened. I thought it was clumsy, and also that in some situations this didn't happen. For example, I could swear in .NET that monitors don't have this problem, but now I'm not sure.

Are you guys saying a semaphore is better for this kind of stuff? If I had to, say, just do a single notification--rather than looping on the condition variable or whatever--what is the most proper way to maintain that variable? I'm fearing that I have been screwing this up.

In Boost, I would provide a predicate function to test that boolean, and I would make the boolean volatile. I can't remember if I'd lock it first, but I know I should. I don't know if I'd need to make it volatile if it was locked. :(

It'd be really weird if .NET monitors worked that way, considering it has semaphores too. It's pretty easy to just write a semaphore using condition_variables and mutexes:
C++ code:
#include <condition_variable>
#include <mutex>

class semaphore
{
private:
    std::condition_variable cv;
    std::mutex mutex;
    int counter;

public:
    semaphore(void) :
        cv(),
        mutex(),
        counter(0)
    {
    }

    semaphore(const semaphore &) = delete;
    semaphore(semaphore &&rhs) = delete;
    semaphore & operator =(const semaphore &) = delete;
    semaphore & operator =(semaphore &&rhs) = delete;

    void up(void)
    {
        std::unique_lock< std::mutex > lock(this->mutex);

        this->counter++;
        this->cv.notify_one();
    }

    void down()
    {
        std::unique_lock< std::mutex > lock(this->mutex);

        while (this->counter == 0)
        {
            this->cv.wait(lock);
        }

        this->counter--;
    }
};

b0lt fucked around with this message at 21:28 on Dec 12, 2012

Suran37
Feb 28, 2009
I am working on a cache simulator. After my program runs I am getting a *** glibc detected *** ./p3.out: double-free or corruption (out). So, it runs the program fine then throws that. The funny thing is that I don't have any mallocs, frees, etc however, some googling has led me to believe it might because by vectors which I am using. Does anybody have any ideas? I can post code if it helps, but I have no idea where the error is throwing.

EDIT: Upon further review I forgot to move a for loop down after rewriting a section of code.

Suran37 fucked around with this message at 23:53 on Dec 12, 2012

raminasi
Jan 25, 2005

a last drink with no ice
Yes, please post some code.

Adbot
ADBOT LOVES YOU

Suran37
Feb 28, 2009

GrumpyDoctor posted:

Yes, please post some code.

I figured it out. I was originally passing the number of lines per set in through the command prompt, but our spec doesn't so I had to re-write that part and forgot to move the for loop that created the vector of sets down after it calculated the lines per set. Somewhere down the line that was causing a problem I guess.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply