#define <stdio.h>
main()
{
char my_string[40];
my_string[0] = 'T';
my_string[1] = 'e';
my_string[2] = 'd';
my_string[3] = '\0';
printf("%s", my_string);
Type: Posts; User: elrookie
#define <stdio.h>
main()
{
char my_string[40];
my_string[0] = 'T';
my_string[1] = 'e';
my_string[2] = 'd';
my_string[3] = '\0';
printf("%s", my_string);
yes I am
i am trying to learn about strings,
how come when i compile this i get an error that states:
macros names must be indentifiers
char mystring[40];
my_string[0] = 'T';
...
ohhh thanks guys now it works... !
#define NUMBER '0'
void push(double);
double pop(void);
int getop(char[]);
int getch(void);
void ungetch(int);
here is a
*/
* reverse polish calculator
*/
#include <stdio.h>
#include "calc.h" /* header file */
# include <stdio.h>
main()
{
int c, n1;
n1 = 0;
while (( c = getchar()) != EOF)
if ( c == '\n')
++n1;
I am getting introduced to pointers and i was reading this intro.
#include <stdio.h>
main()
{
int x = 7 ;
thank you for your suggestions! a lot
I have a question about this piece of code:
char hexdigits[] = "0123456789ABCDEF";
hexstring[index++] = hexdigits[m];
sorry for the screw up code,
can't use printf because it is not allowed.
int itox( char hexstring[], int n) { /* takes in an integer n */
int m, b, flag;
b = (m / 16); ...
Dear friends, I am trying to write a function that will convert an integer to a hex string. I would like to use the switch method. The code below is my work in progress, the logic i'm trying to...
you are right looking at the arguments that getline() accepts and looking at what i'm passing confuses the crap out of me, i can't use getline() then.
#include <stdio.h>
#define MAXLINE 5...
thank you, but could you tell me where my fault lies in my code so at least i could understand why it doesn't work
i like that function fgets() i see it is used a lot to read characters and input, i came across a getline() it was said that it can do the same, i wanted to implement this using the same idea mike...
ohh that program works great,
ohhh i didn't know about 'fgets'.... can you write this without using fgets?
how come i want to use int main?
humm ok this is starting to make sense now,
this is the thought i follow when it comes to 'for' loops:
for (initialisation; condition; iteration) command;
so if i understand it right I...
I'm trying to write a program that will take as an input a string of characters and output their hex representation.
i decided to start off by writing a program that takes in one input character...