Thread: noob

  1. #1
    1337
    Join Date
    Jul 2008
    Posts
    135

    noob

    Code:
    #include <cstdlib>
    #include <iostream>
    #include <time.h>
    
    using namespace std;
    
    int main(int argc, char *argv[])
    {
        
        
     char *count="HOw Are you";
     
        
        
        
        
        
                for (count<100);
                
                cout<< count<<endl;
                
                      
                  
        
        cin.get();
        return EXIT_SUCCESS;
    }

    i got an error during compilation, please help. What i ma trying to do is let the program prints out 100 "how are you"

  2. #2
    Registered User carrotcake1029's Avatar
    Join Date
    Apr 2008
    Posts
    404
    for (count<100);
    Read up on using the correct format for creating a loop.

  3. #3
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,210
    Also this is C++, not C. Make up your mind what language you're writing in.

  4. #4
    Registered User
    Join Date
    Sep 2006
    Posts
    230
    you can't use your char* variable as a counter too. you must declare another integer variable for that job.

    and check the for loop syntax, it's completely messed. check it out here: http://www.cprogramming.com/reference/for.html

    And like MacGyver said, your code is C++ code. Which language are you using? C, or C++?
    I might not be a pro, but I'm usually right

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Noob Q: How to read a value of a byte in binary?
    By Hitsuin in forum C++ Programming
    Replies: 2
    Last Post: 06-11-2009, 02:46 PM
  2. Noob printf question
    By lolguy in forum C Programming
    Replies: 3
    Last Post: 12-14-2008, 08:08 PM
  3. I'm a noob and I need help.
    By nifear4 in forum C Programming
    Replies: 17
    Last Post: 10-14-2008, 01:20 PM
  4. noob needs help!!!!:(
    By tykenfitz in forum C Programming
    Replies: 1
    Last Post: 07-10-2005, 08:49 AM
  5. noob: compiling error... plz help!
    By chosii in forum C Programming
    Replies: 2
    Last Post: 05-10-2002, 05:53 AM