help need big time

Computer builds, hardware and software discussion or troubleshooting, including peripherals. Essentially a general place to talk about desktop computers.
Locked
User avatar
MikeDB
Posts: 1224
Joined: Fri May 13, 2005 3:09 pm

help need big time

Post 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]
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

help need big time

Post 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]
Honk if you love Jesus, text if you want to meet Him!
User avatar
MikeDB
Posts: 1224
Joined: Fri May 13, 2005 3:09 pm

help need big time

Post 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
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

help need big time

Post 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
Honk if you love Jesus, text if you want to meet Him!
User avatar
Death
Posts: 7919
Joined: Thu Sep 30, 2004 10:12 pm

help need big time

Post 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]
User avatar
MikeDB
Posts: 1224
Joined: Fri May 13, 2005 3:09 pm

help need big time

Post by MikeDB »

@Red
Windows
@Furball
Thanks :)

Archived topic from Iceteks, old topic ID:3980, old post ID:32687
User avatar
MikeDB
Posts: 1224
Joined: Fri May 13, 2005 3:09 pm

help need big time

Post 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]
Locked