![]() |
|
|
|||||||
![]() |
|
|
Thread Tools | Rate Thread |
|
|
PM User | #16 |
|
God Emperor ![]() ![]() Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 5,123
Thanks: 2
Thanked 554 Times in 542 Posts
![]() ![]() ![]() |
Sorta, printf takes variables and replaces them based on datatypes.
PHP Code:
Edit:
Got you're last post in there. Check to make sure that the file is being saved as plain text. I don't know where the problem is coming up (mind you, I left my mysql connection string in there, but I assume you already have that in there somewhere). Edit: Wait you said you're error is on line 29? That does correspond to the *'s. Ensure that they are not actually in there, or BOM of some sorts hindering it.
__________________
Code:
struct User *upFou;
userInit(upFou, "Fou-Lu", 1);
printf("%s has %s to %s\n", (*upFou).Name, !quitSmoking(upFou) ? "FAILED" : "SUCCEEDED", (*upFou).Smoker == 1 ? "FAIL" : "PASS");
// Fou-Lu has FAILED to FAIL? Lol
Last edited by Fou-Lu; 11-05-2009 at 09:23 AM.. |
|
|
|
|
|
PM User | #17 |
|
New Coder ![]() Join Date: Oct 2008
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
![]() |
whats BOM?? and i dont think its corresponding to the *s...this is driving me crazy!!!! lol...but i really do appreciate all the help
what do u mean plain text?? its saved as a .php file Last edited by puglover; 11-05-2009 at 09:29 AM.. |
|
|
|
|
|
PM User | #18 |
|
God Emperor ![]() ![]() Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 5,123
Thanks: 2
Thanked 554 Times in 542 Posts
![]() ![]() ![]() |
BOM = byte order markers, generally within the first 4 bytes of a file saved as unicode.
I don't know how to change it in linux, in windows its a matter of opening it and saving as ANSI in notepad. All I can suggest is dump you're IDE and use a plain text editor like kate.
__________________
Code:
struct User *upFou;
userInit(upFou, "Fou-Lu", 1);
printf("%s has %s to %s\n", (*upFou).Name, !quitSmoking(upFou) ? "FAILED" : "SUCCEEDED", (*upFou).Smoker == 1 ? "FAIL" : "PASS");
// Fou-Lu has FAILED to FAIL? Lol
|
|
|
|
|
|
PM User | #20 |
|
God Emperor ![]() ![]() Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 5,123
Thanks: 2
Thanked 554 Times in 542 Posts
![]() ![]() ![]() |
Are you using a particular environment to write code? If so, abandon it and use a plain text editor (vi from the command line or kate if you're using kde).
__________________
Code:
struct User *upFou;
userInit(upFou, "Fou-Lu", 1);
printf("%s has %s to %s\n", (*upFou).Name, !quitSmoking(upFou) ? "FAILED" : "SUCCEEDED", (*upFou).Smoker == 1 ? "FAIL" : "PASS");
// Fou-Lu has FAILED to FAIL? Lol
|
|
|
|
|
|
PM User | #22 |
|
God Emperor ![]() ![]() Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 5,123
Thanks: 2
Thanked 554 Times in 542 Posts
![]() ![]() ![]() |
No clue I'm afraid, I know nothing about macs >.<
Best I can tell, you should have an application called TextEdit. Looks like you'll need to change you're preferences to ignore rich text. Beyond that I'm afraid I can't help, but I'm betting you'll get some interesting characters to show up.
__________________
Code:
struct User *upFou;
userInit(upFou, "Fou-Lu", 1);
printf("%s has %s to %s\n", (*upFou).Name, !quitSmoking(upFou) ? "FAILED" : "SUCCEEDED", (*upFou).Smoker == 1 ? "FAIL" : "PASS");
// Fou-Lu has FAILED to FAIL? Lol
|
|
|
|
|
|
PM User | #23 |
|
Regular Coder ![]() Join Date: May 2009
Location: Horn Toad Ville, CA
Posts: 144
Thanks: 7
Thanked 30 Times in 30 Posts
![]() |
If you are using TextEdit you have to be careful how it processes line breaks... Sometimes it works when you make it plain text other times it keeps the format of the original file on the line breaks. I used to run into problems with it when editing .htaccess files that were accidently started as rich texts then converted over because the line breaks stayed in the wrong format.
Here is a link someone gave me from the MacForums. http://hayne.net/MacDev/Notes/unixFAQ.html The 12th item down is about the end line. It's sad to say but Notepad on Windows is about the most reliable thing without going through a file conversion. Sometimes I get TextEdit to work and others not so that's about the extent of my knowledge on that.
|
|
|
|
|
|
PM User | #24 |
|
New Coder ![]() Join Date: Oct 2008
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
![]() |
thanks for all the help...after hours of trying i still couldnt get this to work on text wrangler...im just gonna go sit at my dads computer and copy everything into notepad++ and hope to dear god that works...if not ill be back
|
|
|
|
|
|
PM User | #25 |
|
Regular Coder ![]() Join Date: May 2009
Location: Horn Toad Ville, CA
Posts: 144
Thanks: 7
Thanked 30 Times in 30 Posts
![]() |
Just be sure to check the line endings in the original Notepad... Notepad 2 uses different line endings than the original... I don't know about Notepad++ though. I'd copy paste all your code over when your done to double check it.
|
|
|
|
|
|
PM User | #26 |
|
God Emperor ![]() ![]() Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 5,123
Thanks: 2
Thanked 554 Times in 542 Posts
![]() ![]() ![]() |
Indeed, it may be appear as a single line in notepad. If thats the case, open it first in wordpad than choose save as a new filename. Than open in notepad, I think thats how I used to fix it between the Linux and M$ machines.
__________________
Code:
struct User *upFou;
userInit(upFou, "Fou-Lu", 1);
printf("%s has %s to %s\n", (*upFou).Name, !quitSmoking(upFou) ? "FAILED" : "SUCCEEDED", (*upFou).Smoker == 1 ? "FAIL" : "PASS");
// Fou-Lu has FAILED to FAIL? Lol
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Rate This Thread | |
|
|