I am still playing with my C handbook and yes, as you can see I have small problem as always
Quote:
Teksbook says
Write a program that reverses the words in sentence.
Use a loop to read charactes one by one and store them in
one-dimensioal char array. Have the loop stop at a period,
question mark or exclamantion point and store it in separate
char varible. Then use a second loop to search backward through the array for the begging og the last word. Print the last word then search backward for the next-to-lat word. Repeat until beginning of the array is reached. Finnaly print the termination character.
I have a class with an integer pointer, which I have not initialized to NULL in the constructor. For example:
class myclass
{
private:
char * name;
int *site;
}
myclass:: myclass(....)
: name(NULL)
{
.....
}
other member function “delete “ the variable before... (2 Replies)
I received a warning when I tried to compile my program that said:
warning: comparison between pointer and integer
Could you please explain to me what this means, and in what ways I could possibly fix this?
Thanks for your help! (2 Replies)
A question to ask.
seq1 = "eeeeeeeeeeeeeeeeee";
seq2 = "dddddddddddddddddddd";
char a = '*';
strcat(*seq2, &a);
strcat(*seq1, seq2);
compilation
warning: passing arg 1 of `strcat' makes pointer from integer without a cast
thanks (4 Replies)
If one wants to get a start address of a array or a string or a block of memory via a function, there are at least two methods to achieve it:
(1) one is to pass a pointer-to-pointer parameter, like:
int my_malloc(int size, char **pmem)
{
*pmem=(char *)malloc(size);
if(*pmem==NULL)... (11 Replies)
Hi,
I am just trying to compare integer in ksh. can you please tell me what's wrong with this code... or give me suggestions on alternative.
sample code:
i=0;
if ; then
echo inside if
fi
Thanks in advance! (6 Replies)
I'm trying to write a programme which scans strings to find how many vowels they contain. I get an error saying that I'm trying to compare a pointer and an integer inif(*v == scanme){. How can I overcome this ? Also, the programme seems to scan only the first word of a string e.g.: if I type "abc... (1 Reply)
Hi
What is the difference between following commands
Command1
length=1
if ] ; then
echo "Hellow world"
fi
Command 2
length=1
if ] ; then
echo "Hellow world"
fi
which is correct usage from this (2 Replies)
I am trying to execute something like this
file=/tmp/test.txt
firstline=$(head -n 1 $file)
value=`echo $firstline | cut -d'=' -f2`
if
then
echo true
fi
i read the first line of a file, cut to the numeric value in the first line and check if it greater than 2
but for some... (11 Replies)
Hi all, I'm new programming in C, so I had the next message in my code:
Dual.c:88:20: warning: pointer type mismatch in conditional expression : &clientSa.sin6.sin6.sin6_addr,
Any help would be great
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include... (1 Reply)
Discussion started by: godna
1 Replies
LEARN ABOUT CENTOS
play_midi
play_midi(3alleg4) Allegro manual play_midi(3alleg4)NAME
play_midi - Starts playing the specified MIDI file. Allegro game programming library.
SYNOPSIS
#include <allegro.h>
int play_midi(MIDI *midi, int loop);
DESCRIPTION
Starts playing the specified MIDI file, first stopping whatever music was previously playing. If the loop flag is set to non-zero, the data
will be repeated until replaced with something else, otherwise it will stop at the end of the file. Passing a NULL pointer will stop what-
ever music is currently playing.
RETURN VALUE
Returns non-zero if an error occurs (this may happen if a patch-caching wavetable driver is unable to load the required samples, or at
least it might in the future when somebody writes some patch-caching wavetable drivers :-)
SEE ALSO install_sound(3alleg4), load_midi(3alleg4), play_looped_midi(3alleg4), stop_midi(3alleg4), midi_pause(3alleg4), midi_seek(3alleg4),
midi_pos(3alleg4), midi_time(3alleg4), midi_msg_callback(3alleg4), exmidi(3alleg4)Allegro version 4.4.2 play_midi(3alleg4)