It should be something like:
i know the length
void rotation(node** n){
int length = 3;
temp = (struct node *) malloc(sizeof(struct node));
Type: Posts; User: peterderijp
It should be something like:
i know the length
void rotation(node** n){
int length = 3;
temp = (struct node *) malloc(sizeof(struct node));
Wel, that's difficult. With array i should do it like this:
i will calculate the length, and than:
char temp = number[0];
for(int i=0; i<length-1; i++){
number[i] = number[i+1];
}...
Dear All,
i try to rotate my linked list. I have a linked list with for example the number 197, where each link contains one number.
Now, i have 197. But i want to rotate that like 971 and 719....
Dear Programmers,
i have a linked list problem. I have have a number, for example 197, and put it in an array----> [0] = 1 , [1]=9, [2]=7
So far so good. Now, i want to make a linked list of...
oh yes, you're right. I make a c program. But i coudn;t find a good compiler, that's why i use visual c++ (do you otherwise know a good and simple one? )
Thanks for your answer. I have 5 compile errors, but i suppose it's because i have a c++ compiler...
Dear Programmers,
i have a problem with linked lists. I have an character array. This will look like this:
array[0] = 1
array[1] = 4
array[2] = 8
Now, i will make an structure:
oh sorry,
now i try to get used to the fundamentals of the assignment i have to make. I have to make an assignment with more than thousends of words. But i want to get used to the fundamentals of...
I also have to use dynamic allocation using malloc. But now i make an array, which will take a lot of memory. I think that will give some problems.
I think i undestand what you're doing. But i...
input = fopen("C:\\month.txt" , "r");
//check if we can access the file, if not, return 1
if( input == NULL ){
printf ("cannot open file");
return 1;
}
char c = '0';
while((c...
that's because i use the Visual C++ compiler i though
so, i need to put one line in an array, then use the strtok function to put the different substring in another array?
but how to implement this with a textfile...
now i have
#include "stdafx.h"
#include <stdio.h>
#include <string.h>
if i have something like:
char *ptr;
char str[]="Testing,testing0,testing1,testing2,testing3,";
ptr = strtok(str, ",");
Dear Programmers,
i have a question about splitting a textfile into an array. I have an textfile month.text which look like this:
...
if i think in the way as i as a human did:
1. start with low to hight (element1-element2-element3-element4)
2. element 1 & element 2 stays the same, interchange element 3 & element 4
3....
Dear all,
i want to randomize the numbers of a char array, like:
if a have a number 1234. With the function itoa i will have an array like this:
a[0] = 1;
a[1] = 2;
a[2] = 3;
a[3] = 4;