Qbasicnews.com
March 02, 2021, 02:23:54 AM
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
:
Back to Qbasicnews.com
|
QB Online Help
|
FAQ
|
Chat
|
All Basic Code
|
QB Knowledge Base
Home
Help
Search
Login
Register
Qbasicnews.com
>
General
>
General/Misc
>
General Programming
>
CHR$() equivalent in C
Pages: [
1
]
« previous
next »
Print
Author
Topic: CHR$() equivalent in C (Read 7712 times)
Skyler
Ancient Guru
Posts: 564
CHR$() equivalent in C
«
on:
April 24, 2007, 01:07:15 PM »
What is it? I'm trying to write a program which adds some specific ascii codes to a string.
Logged
In the beginning, there is darkness – the emptiness of a matrix waiting for the light. Then a single photon flares into existence. Then another. Soon, thousands more. Optronic pathways connect, subroutines emerge from the chaos, and a holographic consciousness is born." -The Doctor
LooseCaboose
I hold this place together
Posts: 981
CHR$() equivalent in C
«
Reply #1 on:
April 24, 2007, 06:41:43 PM »
You don't need to convert, just use a char:
Code:
char c = 65;
printf("c = %c\n", c);
Will print:
Code:
c = A
Logged
esus saves.... Passes to Moses, shoots, he scores!
Skyler
Ancient Guru
Posts: 564
CHR$() equivalent in C
«
Reply #2 on:
April 24, 2007, 08:07:43 PM »
Can I do that with strcat? I'm trying to make a string to print to the system with system().
Logged
In the beginning, there is darkness – the emptiness of a matrix waiting for the light. Then a single photon flares into existence. Then another. Soon, thousands more. Optronic pathways connect, subroutines emerge from the chaos, and a holographic consciousness is born." -The Doctor
LooseCaboose
I hold this place together
Posts: 981
CHR$() equivalent in C
«
Reply #3 on:
April 25, 2007, 05:20:33 AM »
You may be better using sprintf, or if you are using Linux and don't mind your code being unportable you can use asprintf.
Logged
esus saves.... Passes to Moses, shoots, he scores!
Skyler
Ancient Guru
Posts: 564
CHR$() equivalent in C
«
Reply #4 on:
April 25, 2007, 07:30:53 AM »
Actually it's Knoppix. And it's someone else's system, but we won't g there right now....
Logged
In the beginning, there is darkness – the emptiness of a matrix waiting for the light. Then a single photon flares into existence. Then another. Soon, thousands more. Optronic pathways connect, subroutines emerge from the chaos, and a holographic consciousness is born." -The Doctor
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Forum has moved
-----------------------------
=> Forum has moved
-----------------------------
QbasicNews.Com
-----------------------------
=> QB/FB News
=> Site/Forum Issues
=> Challenges
-----------------------------
QBasic
-----------------------------
=> QB Discussion & Programming Help
=> QB Projects
-----------------------------
Qbasic "like" compilers/interpreters
-----------------------------
=> General QB "like"
=> QB64
=> FB Discussion & Programming Help
===> FB Projects
===> FB Documentation
-----------------------------
General
-----------------------------
=> General/Misc
===> Art & Music
===> General Programming
Loading...