Page 1 of 1

help need big time

Posted: Mon Nov 28, 2005 4:36 pm
by MikeDB
Ok how can I make this work?

Code: Select all

#include <studio.h>
int main(void)
{
  int count;

  for(count=1;count<=500;count++)
     printf("I will write my lines fast.");
  return 0;
{
[code] 

[color=#888888][size=85]Archived topic from Iceteks,  old topic ID:3980, old post ID:32678[/size][/color]

help need big time

Posted: Mon Nov 28, 2005 4:45 pm
by Red Squirrel
Did you mean to include stdio.h? But I would do it this way:

Code: Select all

#include <iostream>

using namespace std;

int main()
{
for(int count=1;count<=500;count++)cout<<"I will write my lines fast.";
return 0;
}
[code]

Unless this is a course on C and you have to use C and not C++ then the way I did it is more "new", I guess I can say. 

The using namespace std is part of every program, so no need to know what it does, just put it.  iostream is used for cout<< and cin>> (get user input) and other basic stuff.

for C it's stdio.h I believe, that does all this. 

[color=#888888][size=85]Archived topic from Iceteks,  old topic ID:3980, old post ID:32680[/size][/color]

help need big time

Posted: Mon Nov 28, 2005 4:50 pm
by MikeDB
Ok cool but what would I open it with? how could I veiw what I coded thats all im wierd about.

Archived topic from Iceteks, old topic ID:3980, old post ID:32681

help need big time

Posted: Mon Nov 28, 2005 5:33 pm
by Red Squirrel
Like compiling it? Depends on what compiler you're using. Is this linux or windows?

Archived topic from Iceteks, old topic ID:3980, old post ID:32682

help need big time

Posted: Mon Nov 28, 2005 6:28 pm
by Death
[quote=Mikwiththestick] Ok how can I make this work?

Code: Select all

#include <studio.h>
int main(void)
{
  int count;

  for(count=1;count<=500;count++)
     printf("I will write my lines fast.");
  return 0;
{
[code] [/quote]
 #include <studio.h>

[b] Does not exist, it should read:[/b]

#include <stdio.h>

int main(void)
{
  int count;

  for(count=1; count<=500; count++)
     printf("I will write my lines fast.");
  return 0;
{

[b] Your last parse should be inverted to a } [/b]

[b] I usually use count = count + 1 where you did count++, but I am pretty sure that's valid as well. As for a compilor, I use Dev C++, got it from Bloodshed's site I believe[/b] 

That's all the errors I was able to pick out.  

[color=#888888][size=85]Archived topic from Iceteks,  old topic ID:3980, old post ID:32683[/size][/color]

help need big time

Posted: Mon Nov 28, 2005 8:07 pm
by MikeDB
@Red
Windows
@Furball
Thanks :)

Archived topic from Iceteks, old topic ID:3980, old post ID:32687

help need big time

Posted: Tue Nov 29, 2005 6:09 pm
by MikeDB
Ok how about this?

Code: Select all

#include <stdio.h>

int main(void)

{
  int count;

  for(count=1;count<=500;count++)
     printf(%i," ) This is my message.",count);
  return 0;
}
[code]


I think this might make it go like:
1)This is my message.
2)This is my message.
3)This is my message.
On to 500. 

[color=#888888][size=85]Archived topic from Iceteks,  old topic ID:3980, old post ID:32711[/size][/color]