show us the errors at least
we can't even tell whats in those header files you included.
Type: Posts; User: kurz7
show us the errors at least
we can't even tell whats in those header files you included.
have you even tried it yet?
its very simple.
give it a go first
lol
what were your previous 47 questions? Learning how to write helloworld in 47 different languages?
If you have done those 47 then this should be a catwalk.
1. if n =1, j=5;
while(n<j)
dont forget to compile with the -lm
Can you have nested switch statements? Will this be just as efficient as IF-Else statements? It sure does look alot neater.
Cheers!
e.g
switch(a)
{
case 1:
try using strcmp(member1->data,member2->data) and then perhaps swapping them.
i would use strcmp, but maybe there are other ways.
hmm clever.
Dont have to think about ungetc() now.
Thanks Salem
>> what i want to do is just peek at the next character thats it but if use getchar() then it doesnt work because the character i peek at doesnt return
isnt ungetc() used for files though?
...
Hi Guys.
When i use a while loop to scan in characters for instance
while ( (ch=getchar()) != EOF ) {
if ( ch == '\n' ) {
do this;
if ( (ch=getchar()) == '\n' ) {
do that;
Hi guys.
Below ive written a foldl program which calculates the values in the array with the function add with values in the array from left to right. This is the non-polymorphic function with...
=(
forgot about strcmp
damnit
thanks guys!
Hi guys,
Anyone see whats wrong here?
What im trying to do is input two strings say s and t.
Return true if the string s is at the end of string t.
My function just keeps return true.
cheers!
sorry
when you say unique, the same generated random number cannot appear again?
is there a certain algorithm to do a rotation/shift of an integer x to say n positions right?
rot(x,n)
for example...rot(1234,2)
this would be 3412...
what i tried to do was input the number,...
if you perform the shuffle below, when u exchange the random numbers how will it know that it is not already in the array or not already generated?
i.e. a duplicate occuring
how can the shuffle...
cheers dave
the goto is hard to digest.
but the if statements and what to do next are just as annoying.
im stuck with the conditions.
hmm ive tried placing the tmp array outside of that for loop so that i allow it to scan the whole array for a match.
however if it breaks out of that loop then it will add the value to the tmp...
Hi guys,
Im trying to implement a function/program that generates numbers from 1 to the input number given by the user. I've come close to generating all the numbers however there are some...
just like quzah said.
you need to use strcmp from the <string.h> library to compare strings.
if strcmp returns 0 then they are a match
if strcmp returns 1 then first arg greater then second...
to find out if the array is full of zeroes you could loop through the array and create a flag.
initialise this flag to false to begin with and the go through the array and see if the value is zero....
no you can use the strcmp from the <string.h> library.
so if strcmp( array1, array2 ) == 0
then they are equal
if strcmp( array1, array2 ) == 1
then array1 is bigger then array2
if strcmp(...
i dont think anyones going to do your assignment/homework for you. why dont you give it a try first then we can help
hmm so the moment i enter a decimal number its converted to binary already?
so then just use bitwise operaters and compare and print out the values?
is that the logic here?
thanks guys for the replies.
but just unsure how a number gets converted to binary
for example the decimal number is 20 which is 010100 in binary. How does the bitwise recognise the decimal...