User Profile

Collapse

Profile Sidebar

Collapse
apusateri
apusateri
Last Activity: Jan 3 '07, 05:18 PM
Joined: Oct 2 '06
Location: Mesa, AZ
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • apusateri
    started a topic Question about posting multiple queries

    Question about posting multiple queries

    Good morning (afternoon, evening, whatever),

    I realize this is PHP as well as MySQL, but I had to make a judgement call on where to post the question, hope that's okay...

    Is there any way to run multiple SQLQuery statements to the same array of results?

    For example:

    Code:
    $SQLQuery = "SELECT * FROM SOMETHING WHERE SOMETHING='TRUE';";
    
    $result = mysql_query($SQLQuery);
    ...
    See more | Go to post

  • apusateri
    replied to Prime Number Using For Loops
    in C
    Could you be more specific on your problem, or post some of the code that you've tried in the past with the errors that you're encountering?...
    See more | Go to post

    Leave a comment:


  • apusateri
    replied to Dice program..need help
    in C
    Thanks for the reference, Banfa - hadn't looked at that link before, just going off of the knowledge that I already have. This makes sense, though - appreciate the feedback....
    See more | Go to post

    Leave a comment:


  • apusateri
    replied to Dice program..need help
    in C
    What's a better way?

    With 1000 iterations this one seems fairly random, to me:

    1 - 168
    2 - 150
    3 - 170
    4 - 173
    5 - 168
    6 - 171...
    See more | Go to post
    Last edited by apusateri; Oct 18 '06, 09:24 PM. Reason: Addition

    Leave a comment:


  • apusateri
    replied to Dice program..need help
    in C
    Try this out, threw it together real quick here because I've got to get back to work, but I compiled it and it should run.

    You can clean up the code and rename variables, etc... for your own purposes:

    Code:
    #include <iostream>
    #include <cstdlib>
    #include <time.h>
    
    using namespace std;
    
    int rollDice();
    
    int main(int argc, char* argv)
    {
    ...
    See more | Go to post

    Leave a comment:


  • apusateri
    replied to Plz Help Me To Modify Program...
    in C
    You're right, meant to say string.

    My mistake....
    See more | Go to post

    Leave a comment:


  • apusateri
    replied to Plz Help Me To Modify Program...
    in C
    Do you have your variables set up as integers? int 1 + int 1 = 2, but char 1 + char 1 = 11... Other than that, I agree with the previous comment, I'd like to see some more code to know what is going on here. That was just a "quick check" I wanted to offer....
    See more | Go to post

    Leave a comment:


  • It's going to depend on which graphic library you use - Direct3D, OpenGL, SDL?...
    See more | Go to post

    Leave a comment:


  • apusateri
    replied to a missed IF statement
    in C
    Your condition is checking if x_initiial_velo city is less than 5, but I don't see that variable ever declared or assigned a value in the above code.

    Should it be x_velocity?...
    See more | Go to post

    Leave a comment:


  • apusateri
    replied to a missed IF statement
    in C
    Can you include some of the code from the project so that we can see where there might be an error in the algorithm?
    See more | Go to post

    Leave a comment:


  • Hey there, I'm a little confused - can you use the CODE /CODE tags so that the whitespace is preserved and we can get an idea of what you're looking for.

    Also, is this supposed to be purely text-based (i.e. command prompt) or are you planning on using a graphics library for this?

    Thanks....
    See more | Go to post

    Leave a comment:


  • apusateri
    replied to the cmd window close!
    in C
    Have you tried system("pause") ?...
    See more | Go to post

    Leave a comment:


  • apusateri
    replied to Functions & Files
    in C
    No problem, glad I could help - as far as automatically putting the data in a file, I'm not sure if, or how, it could be done, but I would check around on that resource, it has quite a bit of good information....
    See more | Go to post

    Leave a comment:


  • C++ in and of itself won't draw graphs, you'd need a graphics library to do something like that. Might want to take a little time looking into Direct3D, OpenGL, or even SDL and seeing how those libraries work.

    Once you've got some basic knowledge on that drawing graphs should be a piece of cake...somewhat :)...
    See more | Go to post

    Leave a comment:


  • apusateri
    replied to Functions & Files
    in C
    Nevermind, I worked it out for you. Again, try and see if you can get it by looking at the instructions, if not, this will work:

    (FYI - I changed your while loop to a do/while loop... char isn't initialized at a value, so the do/while will occur at least once, to be safe, in all cases)

    Code:
    #include <iostream>
    #include <fstream>
    #include <math.h>
    using namespace std;
    ...
    See more | Go to post

    Leave a comment:


  • apusateri
    replied to Functions & Files
    in C
    There's quite a bit involved with the ofstream functions, check this out and see if it helps. If not, let me know, and I'll see if I can put something together for you. Thanks!

    http://www.cplusplus.c om/ref/iostream/ofstream/...
    See more | Go to post

    Leave a comment:


  • apusateri
    replied to int in C++ (newbie)
    in C
    Glad that it worked for you.

    FYI, however

    Code:
    nt  x, y, sum;
       sum = addNumber(x, y);
    You don't need to declare x or y, or pass them to the function, as you are obtaining the values for those two numbers within the function itself. Declaring x and y, and then passing them to the function, doesn't actually do anything useful for the program.

    Just a side note, glad I could...
    See more | Go to post

    Leave a comment:


  • apusateri
    replied to Functions & Files
    in C
    Try this one, just compiled it and it should work:

    Code:
    #include <iostream>
    #include <fstream>
    #include <math.h>
    using namespace std;
    
    int findLargest(int a, int b, int c);
    void printMyName();
    double findAverage(int a, int b, int c);
    
    int main ()
    {
    	int a, b, c, largest;
    	double average;
    
    	// First function
    ...
    See more | Go to post

    Leave a comment:


  • apusateri
    replied to Value-return functions questions???
    in C
    Okay, here we go:

    1.

    Code:
    float halveNumber(int a)
    {
       float result;
       result = a / 2;
       return result;
       
       // Could probably write this easier as simply
       // return a / 2;
       // but I wanted to show the operation
    }
    2.

    Code:
    char getChar()
    {
       char result;
       cin
    ...
    See more | Go to post

    Leave a comment:


  • apusateri
    replied to int in C++ (newbie)
    in C
    First of all, when you're creating this function, since you're going to ask the user for the inputs, you don't need to include them in your function.

    Also, you don't need to return all three values, only the resulting summation (c in your case)

    i.e.

    Code:
    int addNumber()
    {
       int a, b, c;
    
       cout << "enter a" << endl;
       cin >>a;
    ...
    See more | Go to post
    Last edited by apusateri; Oct 10 '06, 08:00 PM. Reason: Typo

    Leave a comment:

No activity results to display
Show More
Working...