WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Ouch... I think I need to talk to my wife!

WolfPack commented: g00d luck. h0p3 y0u g37 l41d. :D +7
arjunsasidharan commented: good one :D +2
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Oh, this makes perfect sense! I can explain it very easily....

N R A

:icon_wink:

christina>you commented: ;o) +9
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Also, please read the Rules so you can make good posts with useful titles and questions.

Salem commented: Quite so. +7
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

OK, how does someone give reputation that's gray? What does it mean?

And can the comment box be a required field when giving reputation?

Serunson commented: My rep back to ya :P +4
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

To pause use system("PAUSE");
and #include <stdlib.h>

No, do not use system("PAUSE") . Here's why

Aia commented: Always helping people. +2
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

BGI graphics was designed for earlier Borland compilers and won't work with 5.0+. So you have to rewrite the output portions of the program to remove the screen manipulation. Or you can find a graphics package you like and rewrite the output sections.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

I'm a funguy.... But I'm not really an animal. I'm better behaved.

I find it sad that new laws have to be passed because somehow stupid laws have been passed in the past (I like that sentence -- it alliterativy) and people by law can't do something reasonable.

Dani commented: Funguy, eh? Cute. +10
Aia commented: You always make me laugh with your sense of humor. +1
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

haha.. I was just joking.. I'm a realist.. So I've got to say that no, I do not believe we have made any contact with other life forms.

Why is being a realist counter to life forms contacting us? There's some logic missing here...

Yeah, I don't believe in them lol.

And they don't believe in you. That's why you've ceased to exist :icon_mrgreen:

It was cheaper to go to the moon than to fake it? lol... I think not... It would be much easier and much cheaper to simply film the first 'moon landing' in a studio or something.

When was the last time you saw a 1960's science fiction movie? Easy to fake my butt!!!

Every time you have someone enter or leave, you've got to start over at removing the vacuum.

Can we say airlock kiddies? Or is that technology available? If not, how did divers leave submarines :icon_rolleyes:

John A commented: Love ya and your logic Walt :icon_mrgreen: +11
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

I inttially thaught about a rep war but then decided against it, i think others will do the same/

Yeah, I was gonna bad rep you big time, ol' buddy! Then I decided you're a good kid so I left you alone :icon_mrgreen:

jbennet commented: thanks ;) +12
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Seven Points Against Evolution
...
I also want to say that objectively setting religion aside, evolution just seems illogical to me and I will explain why with a few examples.

1)I see two types of sciences: concrete and interpretive. Concrete sciences are like chemistry and physics. They are based one hundred percent on proven facts and nothing else is accepted....

So Einstein's Relativity obviously does not fall within the concrete sciences. And where does Maxwell's Electromagnetic equations fall? Biology?

4) Evolution is not something that can be tested. There is no test to prove it false. In order for a hypothesis to be scientific there must be some way to prove it false and there is no test for this one. That means it's unscientific.

7) Evolution has simply never been proven even after all these years.

So point us to the test that shows that Creationism is experimentally tested and therefore true.

Read up on the definition of the word "theory" and how it relates to science.

WolfPack commented: Either the reputation spread system doesnt work, or I have handed a lot of reputation today. If the rep spread is off, would love if some one gave me a lot of rep for all the posts I have made. :D +6
joshSCH commented: Thanks for somewhat carrying on for me. At least, pointing out their foolish flaws +6
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Laugh it up, fur ball! :icon_mrgreen:

WolfPack commented: Yep. The Spread is off. Please Please before Dani finds out about this and fixes the bug. m(__)m +6
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Personally, I sometimes use while(1) or similar for things like menus, where choosing a menu option would cause the program to do something and then return to the menu. Then, if you want to exit the program, just return 0 to end the program:

int main()
{
   int bob;
   while(1)
   {
      cout << "Enter a number to display, or -1 to exit: ";
      cin >> bob;
      if(bob == -1) { return 0; }
      cout << bob << endl;
    }
}

This is generally not recommended, although it does work. The reason is you are burying the exit from the function/program in the middle of your code. This could be a maintenance nightmare for the team that inherits your program (or for you in 2 months :icon_wink:) It would be best to break out of the loop and return at the bottom of the function.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

The only people who've said they're capable of giving out negative rep are moderators, sponsors, etc, so far.

Interesting. The Power!!! I feel like a ghod! (no, not Him, one of the lesser ones, like Ra or Loki. Yeah, That's it. Loki = me!)

I can still hand out +ve and -ve rep. Maybe some problem at your side. Let Dani know of this one.

Maybe I should give neg rep for your use of -ve and +ve. It's silly! Just use + and - because it looks like you mean something else and can't type. :icon_smile:

Also, has anyone noticed that the option to give bad rep is gone???

You wanna give someone bad rep, just let me know. I'll do it for you -- but it'll cost ya later.

arjunsasidharan commented: :D +3
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Well that is your opinion,,,

This is the way I sent it here, because of the school I am attending,,,

If you are an expert then send me a better looking code I uploaded.

My opinion too, as well as most experts here. Check out this info about better formatting techniques, then post using the instructions on the background of the input box that explains CODE tags (or see this)

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

WaltP - what is your belief? - are you atheist also?

No. I'm one of those agnostic thingies. I believe there is something that is God-like (it's not sentient per se) but not as defined by major religions.

From what i rember carbon dating can have a 2-300 year error margin or mayb it was in the thousands either way i rember that it was not entriely accurate.

Hmmm, so worst case scenario, the tool found that was carboon dated to 23000 years old might only be 20000. Still well beyond the 6000 defined by some Creationists.

That seems like a shallow excuse for "I don't know." So carbon dating is a lie? Who are YOU to say that millions of scientists are wrong? It Is a SCIENTIFIC FACT that the earth is 4.5 billion years old and that evolution happens. It is as much of a fact as the fact that I have five fingers on each hand

But its not Fact though just because alot of people say its that old does not make it true.

Science says it's true. It's not an opinion made up by people just because they want it to be true.

I also do not think that there is overwelming evidence that the earth is that old and alot of the things things like fossils and rock layers etc used as an argument for this can also be explained by a world wide flood.

Then you need to read more. For one …

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Hmmm

christina>you commented: cute smilies :) - Christina +4
arjunsasidharan commented: i like the green one how did you make the second one's eyes move +1
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Yes, you can write either program without strings. Very easily.

Specially whatever i make i should able to grasp it comletely in order to explain to the prgrammer !!

As you should with all programs you write...

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

can anyone figure out why this program is printing different numbers from what is input and also calculating the wrong average. answer ASAP PLEASE.

I hate being ignored!!! READ THIS!

Salem commented: Just delete the rubbish until they learn some netiquette! - Salem +6
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Another thing to consider is the line else if ( ( a == b ) && ( a == c ) && ( b == c ) ) is a little longer than it needs to be. If a == b and a == c, isn't b automatically equal to c?
Therefore, only 2 terms are necessary. This of course does apply to !=...

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Did you stop reading my post after the questions? I followed it with the answers... :rolleyes:

Salem commented: I know what you mean! - Salem. +6
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

I'll maybe look into adding some new smilies. However, I really do like to be original (as with our entire design) and don't want to just find a smiley pack somewhere on the web at the risk of them being copyrighted or mislabeled as public domain, which could compromise our reputation.

So let's design new smileys! How hard can it be?

Sulley's Boo commented: cute icons :D +3
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

You know, I just went through this entire thread and saw absolutely no code by Jerry. How can we help if you won't even try anything suggested, and/or won't post what you've tried?

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Yes you can do the same in c++ so use cout in c++. Period.

Wanna bet?

Ongoing challenge no one has solved yet:

Convert this printf() statement into readable C++, output must match exactly:

int iVal = 2;
int hVal= 0x0C;
char *filename = "test.fil";
char *username = "juser";
float fValue = 23.8;
printf("%4d  0x%02X  Testfile: [%10s]  user: [%-10s]\nTrial %8.2f \n", 
        iVal, hVal, filename, username, fValue);

Output

2  0x0C  Testfile: [  test.fil]  user: [juser     ]
Trial    23.80
John A commented: Heh. --joeprogrammer +8
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Thanks a lot. It's reading the file just fine now but I noticed another problem after running through a couple generations. I neglected to include a command to populate a cell with three neighbors. No kids means everyone just slowly dies out. Here's the relevant code (let me know if you need more):

I don't think I understand. What does this code do?

if (neighborcount == 2)             // 2 neighbors 
    tempWorld[i][j] = World[i][j];  // stays alive.
      else if (neighborcount == 3)        
    tempWorld[i][j] = true;         // 3 neighbors:
                                        // stays alive

      else tempWorld[i][j] = false;      // 1 and 4+ neighbors:

Doesn't it test for 3 neighbors?

And please format your code better -- it's a little hard to follow. You need more {}'s and proper indentation to make it easier to read.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

OK:

#include <stdio.h>
int main(){char ch[]={83,111,114,114,121,44,
32,119,101,32,119,111,110,39,116,32,100,111,32,121,111,117,114,
32,104,111,109,101,119,111,114,107,32,102,111,114,32,121,111,
117,46,10,73,39,118,101,32,97,108,114,101,97,100,121,32,112,97,
115,115,101,100,32,109,121,32,99,108,97,115,115,46,10,0};int i=
0;while(ch[i]){putchar(ch[i++]);}return(0);}
Salem commented: Touche - Salem :D +6
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

The code is above!

You mean after all these suggestions you haven't made any changes to the code you posted? No wonder it's not working. :rolleyes:

John A commented: What the heck, you deserve some more rep after all your hard work... --joeprogrammer +8
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

I would do it like this:

1. Ask the user for file name of file they wish to write data to. 
2. Store file name in to a variable.
3. Open file. 
4. If file not open 
      issue an error message
   else
      Start a loop:
      A. Enter user data. (implies ask/accept)
      B. If finished, exit loop (5)
      C. Write data to file 
      D. Continue loop
5. Close file
Aia commented: Very clear. Aia +1
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

I completely agree. Call them every few days to get an update.
As for:

  1. Keep contacting the owner of a business feverishly until you secure the job.
  2. Keep contacting the owner of a business until you are told : "No, now GO AWAY!

This must also be tempered with good sense. Again, every few days... Every day may be too much, only once is too little. Just enough to show major interest and stick-to-it-iveness but, as has been said, don't be a stalker...

mattyd commented: help with advice # Thank-you ___ MattyD +5
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

:twisted:
a a
n n
n d
o
u g
n o
c o
e g
m l
e e
n
t
s
:p

WolfPack commented: Nice - WoLfPaCk +5
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

It doesn't, but the smallest prime number is 2, so the largest prime number for n is n/2. Anything >n/2 and <n cannot be a factor of n, so why check above n/2

thnx. but wat beats me is .. what is the need for n/2 ?

why do we need to consider half of the no. to check if its a prime ?:-|

Sheesh! OK, you want to find out if 31 is prime. What's half of 31? 15, rounded down. The next value is 16. Can 16 possibly be a factor of 31? How about 17, 18, 19...? If it's impossible, why check them? Therefore you can stop checking at n/2

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

And this is just my opinion, but: I don't really see why using numbers in place of characters makes the code any clearer.

Yeah.... well it is a good thing it is your opinion. :lol:

Well, it's not just your opinion, Joe. I am in complete agreement that
if ((str[i] >= 'a' && str[i] <= 'z'))
is extremely more readable than
if ((str[i] >= 65 && str[i] <= 90))
And it will even work for code on EBCDIC machines... :p

I'd like to hear any dissenting opinion that is sensible...

John A commented: Well, that's good to know, thank you. --joeprogrammer +8
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

can u gv an example of the way u said juz now? thanks....
and also the error juz now i state at the 1st post... thanks

ok.... 10s.. i will try to read it out 1st...

hm... look like the way u write is different from wat i write........ so i need more time to understand it..........

did u understand the 2nd code that i post up juz now?

OK, it's now time for you to read the Rules. You should read them all, but this first paragraph is important...

Salem commented: random rep++ from salem +6
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

wow... that was incredibly mean.

Wasn't meant to be. Sorry

pileum (really!)

mattyd commented: pileum # good word-- mattyd +5
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Let's go back to the code in your first post -- in this thread.

#include<stdio.h>
#include <stdlib.h>
#include<conio.h>      [I]//** kill this -- you shouldn't use it[/I]
#include<string.h>
#define MAXLEN 15

FILE *Entrada;
FILE *Salida;
void main()           [I]//** main is NEVER a [B]void[/B], it's an [B]int[/B][/I]
{
 int i,n;
 char s;
 char arreglopalabra[];  [I]//** you never assigned any space.
                         //** I assume this is for the words?  Define the 
                         //** both the max word size and max number of 
                         //** words:
                         //**  [B]char arreglopalabra[MAXWORDS][MAXLENGTH][/B]  [/I]

 char puzzle[];          /[I]/** same here[/I]
                         [I]//**  [B]char puzzle[MAXROWS][MAXCOLS][/b][/I]

 Entrada=fopen("C:\\TC\\BIN\\input.txt", "r");
 Salida=fopen("C:\\TC\\BIN\\output.txt", "w");

 if (Entrada==NULL || Salida==NULL)
 {
  printf("ERROR");
  getch();    [I]//** change to [B]getchar()[/B][/I]
  return;
 }
 else
 {
     while(!feof(Entrada))  [I]//** See [b] this [/b] -- and it doesn't go here anyway[/I]
     {
        //** read the first line (number of words
        //** Loop reading that many words into [I]arreglopalabra[/I]
        //** Don't you need to know the size of the puzzle?
        //** Read each line of the puzzle -- in a loop
        fscanf(Entrada," %d %s ", &n, &arreglopalabra, &puzzle);

        fprintf(Salida, " %d %s ", n, arreglopalabra, puzzle);

     }


 }

 clrscr();   [I]//** get rid of this, too[/I]
 printf("\n %d %s", n, palabra);
 getch();    [I]//** change to [B]getchar()[/B][/I]
 fclose(Entrada);
 fclose(Salida);
}

clrscr() and getch() should not be used -- they are not standard. clrscr() hasn't been used for 10 years (about) so won't work when you get out in the real world. getch() is not defined everywhere (only 2 current compilers) so will also cause problems in the real …

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Whatever code-coloring method you're using, please stop it. Instead use code tags which are immensly better, and have coloring built-in if you use (code=language)

And Format your code!!!!! Slamming everything to the left edge makes the code impossible to read!

Salem commented: You tell 'em - there's way to much slop on DW - Salem +6
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague
/* You really shouldn't use goto's they're gay but what-the-hell */
    End:

"Practice what you preach."
If you
1) know you shouldn't use them,
2) then say you shouldn't use them,
3) and do it anyway,
what are you teaching the people that are new to the language? It's confusing because for them, the code is now useless. They don't understand enough to know what to ignore and what is good... FYI... ;)

John A commented: Good points... +6
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Is there really anything wrong with learning VisualBasic?

NO.

That is really the only reason i want to learn a language like c, c++, c#. So many people have told me that vb is "too sissy".

They need to grow up.

Personally i love VB. The code is easy to understand (coming from a BASIC background), and i caught on fairly fast. The only problem is that i have been "picked on" about VB, so i decided to see what all the hub bub is about...

I've been programming probably longer than you've been alive, long before C, C++, and VB even existed. For doing GUI programming, VB is quite good. You can build pretty robust applications and fairly quickly. C/C++ is better for commercial applications, but for in-house and personal apps, VB works quite well.

Don't let others try to make you feel bad because of VB. They are programming snobs. VB is just not the "in" thing anymore, but it's still alive and kicking...

Ravalon commented: Let there be approval ^_^ -Raye +1
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Another thing you need to consider is fflush(stdin); /* workes with this compiler */ doesn't work with most. Don't get into a habit that will be hard to break later. It may work now, but it is wrong

Salem commented: Good show! - Salem +6
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

1) ABKLJFDLKJLKKDFJ++++++ajkadsl;fkjld;akjk=====daskflj342343
1a)
ABKLJFDLKJLKKDFJ
++++++
ajkadsl
;
fkjld
;
akjk
=====
daskflj342343

Explanation: program groups letters and characters together, but moves to next line when a symbol is reached.

Look at isalpha(), isalnum(), and isdigit() functions

2) It also must recognize whitespace: A + B = C
2a)
A
+
B
=
C

isspace() for this.

3) It must recognize a matrix: D_1 = [1 3; 2 3 4; ; 4 5 6]
3a)
D_1
=
[1 3; 2 3 4; ; 4 5 6]

Work on this last....

4) If the user forgets the second bracket to a matrix: D_1 = [1 3; 2 3 4; ; 4 5 6

4a)
D_1
=
Need ']' to close matrix

Keep a counter for each pair of [, {, ( seen. Inc at open, dec at close. If by the end of the input any are not 0 you have a mismatch.

5) A regular sentence: Hello How are you
5a)
Hello
How
are
you

What about them? Would aple banena charry be acceptable as a sentence? I think this would be beyond the scope of your program.

6) Anything including invalid segments. The only valid operator segments are +-/* Invalid operator segments could be: +%-, +&!
Valid number segments can start with '.' or a digit. …

John A commented: Good info; thanks WaltP :) - joeprogrammer +6
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Hi there I was wondering how to get visaul basic to bring up another form when a button is clicked. what I am looking to do is have a database (SQL 2005) that uses two tables but in the same database but have each table on a different form. but what i want to do is link these forms together at a click of a button:?:

Just show the form ( formName.Show ) in the click event of the button.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

a turkey baster

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

While coding the decrypter, I came across some issues as well. So here's what I need help with so far:

I need to get the following numbers into a loop to read off of an array that has the encrypted 100 char message.

1      2     4     7    11    16    22    29    37    46
3      5     8    12    17    23    30    38    47    56
6      9    13    18    24    31    39    48    57    65
10    14    19    25    32    40    49    58    66    73
15    20    26    33    41    50    59    67    74    80
21    27    34    42    51    60    68    75    81    86
28    35    43    52    61    69    76    82    87    91
36    44    53    62    70    77    83    88    92    95
45    54    63    71    78    84    89    93    96    98
55    64    72    79    85    90    94    97    99   100

As suggested previously, look at the numbers and look for a pattern.

As well as getting the bottom two loops into 1 loop.

for (z=0;z<10;z++)
    {
        x=0;
        y=z;
        do
        {
            cout << e[x][y];
            x++;
            y--;
        }
        while (x<=z);
    }
    for (z=1;z<10;z++)
    {
        x=z;
        y=9;
        do
        {
            cout << e[x][y];
            x++;
            y--;
        }
        while (x<=9);
    }

Any hints or help appreciated greatly :mrgreen:

An algorithm does not have to be a single loop. IMO you have the answer here. There is no need to complicate the thing by trying to cram both loops together into one.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

:)C'mon Walt -- surely you come from the time when rote memorization was taught?

Yep -- and if you don't use it, you lose it. I've never typed most of those words (they all came from a list).

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

I always think that a programmer should know what's under the hood. I think that starting with Assembly and then moving up is something that new programmers should always do. It means that you have a good grasp as to what is going on and can optimize your code by getting closer to the CPU.

I disagree with the timeframe, but not the concept. Start with a higher level language like C/C++. Once you get a good grasp of programming concepts, then take assembler to see what's under the hood. Trying to learn the terse programming of assembler while trying to understand the concepts of programming in general is just too much IMO.

It's an unpopular opinion but I'm glad I took the time years ago to go through x86 and 6800 assembler classes (these were geared for embedded devices) as it gave me a very good understanding of what is going on in the CPU and how the memory is being organized and utilized. It really gives you ultimate control over your system as well.

I myself know PDP-10 and PDP-11 assembler as well as 80xxx, and have a basic understanding of a couple more, so I know where you are coming from. I do agree that knowing assembler is a great idea. It just shouldn't be the first language.

John A commented: Very well put. - joeprogrammer +4
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Oh, oh!! Me! Me!! **he shouts waving his hands wildly** :mrgreen:


(just kidding)

John A commented: Here you go :) -joeprogrammer +4
~s.o.s~ commented: Here you go my boy...;) - ~s.o.s~ +11
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Keep in mind, cin is the C++ version of C's scanf() and must be used appropriately. IMAO that means -- don't! ;)

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

The problem is when you do scanf ( "%c", &reply ); you press two keys, a character and ENTER. The scanf() reads the character and leaves the ENTER for the next read. You need to clean out the input buffer (and fflush() is not the way to do it). You can use a loop that reads the input buffer until it reaches '\n' at which point it exits. That way you can enter YES, YEAH, YOU BETCHA and the read still works fine.

And be sure to read the links Salem posted.

SpS commented: Good ~~SpS +3
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

I prefer the second form. I personally don't like prototypes in a function body. They get lost too easily.

You also don't need so many lines between code blocks. The farther they are away from each other the harder it is to compare.

SpS commented: Same here: SunnyPalSingh +3
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Maybe this will be easier to read:

structure Moviedata  // to my knowledge structure is not a keyword, 
                     // change it to struct not structure and see 
                     // what happens

int main()
{

    structure Moviedata ;  // this doesn't declare an object of type 
                     // Moviedata but this would----Moviedata data;  Note 
                     // in C++ you don't use the keyword struct or class 
                     // when decalaring an object of the type, you use 
                     // struct/class only when declaring the struct/class 
                     // itself.  

    cin.getline(movie.title,string movietitle);  // 1) don't pass type 
                     //     names as arguments to functions.  
                     // 2) this type of getline() takes a C style string  
                     //     as the first argument.  Since you are using STL 
                     //     strings as member variables of the Moviedata 
                     //     struct you want the other type of getline 
                     //     anyway (see the type you use below).  If you 
                     //     declare a variable of type Moviedata by the 
                     //     name of data then you could do something 
                     //     like this:
                     //             getline(cin, data.movieTitle);

    getline(cin, data.stringdirector); // 1)there is no object by the name 
                     //     of data declared that I can see, and 
                     // 2) even if there was, there is no member variable 
                     //     called stringdirector in the struct Moviedata

    getline(cin, data.int yearreleased); //again, 1) where is data declared 
                     //     as an object in your code.  
                     // 2) don't pass the variable type name, just the 
                     //     variable name itself

    getline(cin, data.runningtime); // correct getline syntax for STL 
                     //     string, but runningtime isn't a member variable …
John A commented: Hard work. :) --joeprogrammer +4
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

how should i modify my IF statement in order for the query to execute properly based on the conditions provided?..

You are using the wrong process.
1) Load the query string into the variable (the sprintf() part)
2) Execute the query using some database function. This you didn't do.
3) Now check the return from the database call with the IF