techPowerUp! Forums

Go Back   techPowerUp! Forums > Software > Programming & Webmastering

Reply
 
Thread Tools
Old 11-03-2009, 07:27 PM     #1
[I.R.A]_FBi
Eligible for custom title
 
[I.R.A]_FBi's Avatar
 
Join Date: May 2007
Location: c:\programs\kitteh.exe
Posts: 5,387 (5.87/day)
Thanks: 572
Thanked 441 Times in 382 Posts

System Specs

A little C help for my friend

He's getting a "multiple declaration for 'printf'" error for this code block, personally i cant see it

Code:
 switch (code)
     {
      	case '1':

          printf:("Very good!!");

          break;

         case '2':

          printf:("Keep it up!!");

          break;

         case '3':

          printf:("Nice job!!");

          break;

          case '4':

          printf:("Excellent");

          break;
     
     }

the erro comes up for the last 3 printf's
__________________
Rig 1+1
Athlon XP 2200+, MSI KM2M Combo, ATI 9200SE 128 MB DDR, 2 X 512 MB DDR333, 250GB + 80 HDD?

“try intel cpu, amd is only good for going to nude sites” -firehawkxd

“go for the 5850 now and play games while the nvidiots wait for the ceo to show an actual working product” -W1zzard
[I.R.A]_FBi is online now  
Reply With Quote
Old 11-04-2009, 02:24 AM     #2
Kreij
TPU Hit Squad Member
 
Kreij's Avatar
 
Join Date: Feb 2007
Location: Cheeseland (Wisconsin, USA)
Posts: 3,242 (3.18/day)
Thanks: 92
Thanked 767 Times in 582 Posts

System Specs

I'm pretty rusty on my C code, but maybe he could try something like this...
Code:
string CaseReturn;

switch (code)
{
    case '1' :
        CaseReturn = "Very Good!!";
        break;
    case '2' :
        CaseReturn = "Keep it up!!";
        break;
}

printf:(CaseReturn);
Sorry, it's been ages since I've used regular C code.
Kreij is online now  
Reply With Quote
Old 11-04-2009, 06:16 PM     #3
Oliver_FF
250 Posts
 
Oliver_FF's Avatar
 
Join Date: Oct 2006
Posts: 459 (0.40/day)
Thanks: 23
Thanked 55 Times in 47 Posts

System Specs

Code:
printf:("Keep it up!!");
What's with the : after the function name and before the parameters?

Code:
printf("Keep it up!!");
Oliver_FF is offline  
Reply With Quote
Old 11-04-2009, 08:50 PM     #4
Kreij
TPU Hit Squad Member
 
Kreij's Avatar
 
Join Date: Feb 2007
Location: Cheeseland (Wisconsin, USA)
Posts: 3,242 (3.18/day)
Thanks: 92
Thanked 767 Times in 582 Posts

System Specs

I didn't know either, but I wasn't sure if he was using some strange compiler that wanted different syntax or something.
__________________
53452340602F55453253602E35572D$20
Kreij is online now  
Reply With Quote
Old 11-04-2009, 08:57 PM     #5
W1zzard
Administrator
 
W1zzard's Avatar
 
Join Date: May 2004
Location: Stuttgart, Germany
Posts: 7,624 (3.78/day)
Thanks: 79
Thanked 2,492 Times in 935 Posts
Send a message via ICQ to W1zzard Send a message via AIM to W1zzard Send a message via MSN to W1zzard

System Specs

ummm not printf:

just printf

Code:
switch ('0')
{
  case '1':
    printf("Very good!!");
    break;
Quote:
Originally Posted by Kreij View Post
I didn't know either, but I wasn't sure if he was using some strange compiler that wanted different syntax or something.
then it wouldn't be c anymore
W1zzard is offline  
Reply With Quote
Old 11-05-2009, 01:16 AM     #6
[I.R.A]_FBi
Eligible for custom title
 
[I.R.A]_FBi's Avatar
 
Join Date: May 2007
Location: c:\programs\kitteh.exe
Posts: 5,387 (5.87/day)
Thanks: 572
Thanked 441 Times in 382 Posts

System Specs

damn ... blame the cocomania i was having when he came by and asked me
__________________
Rig 1+1
Athlon XP 2200+, MSI KM2M Combo, ATI 9200SE 128 MB DDR, 2 X 512 MB DDR333, 250GB + 80 HDD?

“try intel cpu, amd is only good for going to nude sites” -firehawkxd

“go for the 5850 now and play games while the nvidiots wait for the ceo to show an actual working product” -W1zzard
[I.R.A]_FBi is online now  
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Friend needs help w/ build. Cja123 System Builder's Advice 20 09-21-2009 12:05 AM
Little help please for a 1st timer tonyhague GPU-Z 3 02-22-2009 12:29 PM
Help a friend, glitch Azazel General Hardware 4 01-16-2009 12:16 AM
Friend needs some upgrade help Bow General Hardware 3 01-06-2009 03:23 AM


All times are GMT. The time now is 07:22 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
no new posts