wouldnt that be a 00001020 on big endian? :confused: The rest is like Lurking Cat said :cool:
Type: Posts; User: blackswan
wouldnt that be a 00001020 on big endian? :confused: The rest is like Lurking Cat said :cool:
If I hate Java, will I hate C# too?
thanks man! Great help! :D i would give you points, but this forum doesn't have that feature :D
Using fgets like you said now works. I will now do the buffer overflow an line checks and look on sorting using qsort.
To explain:
#1: Well, I had an intention to fix the buffer overflow and number of lines check...but I just need something that works for a start..I was aware of the fact you pointed to me.
...
Im trying to write a program that reads a txt file and copy's all the lines in an array of strings and then sorts the strings by the length and then outputs the array of sorted strings...It compiles...
int fib(int n) {
if(n<=1)
return n;
else return fib(n-2)+fib(n-1);
}
A little recursion to spice things up. :p
add this before the last brace:
return 0;
Thank's zook. That cleared my head:)
Oh, yes I forgot. I was in a hurry... Okey, I know I can have strings like this:
char *array[]={"one", "two"....};
But I want to make an array of strings which wont be initialized at first. And...
Let's say I wanna read a strings from a file and store them into a string array.
char array [] [80];
#include<stdio.h>
#include<stdlib.h>
#define STACK_SIZ 10
long int stack[STACK_SIZ];
int top=0;
void push(long int n);
void pop(long int n);
void print_stack(void);
The char *str is null terminated too, but...see cwr's post above.
Thanks guys for clearing that to me! :)
Aaaaaaaaaa...thanks man! :) I was using a char *str instead of char str[].... :D
I still get the segmentation fault :confused: :confused:
I have a simple question. Let's say I want to change all the spaces in a given string with a '+' character. I have to do this with pointers.
void change(char *ps){
...
ouch..havent seen the code properly before. I didn't see that factory is a pointer to your struct. Yes. Like the man before me said, pass the address of the variable. See how push and pop are...
lool :) Dude, you are on hardcore programming grounds. There are no objects like in higher languages here :)
THere are times when I ask myself: "Why the ........ is C built that way??!!!"
IM kidding... :p
Thanks for explaining...so the thing in braces is just telling the function what type the...
I have a question about the pthread_create function.
A normal use of that function would be something like this.
int itr =pthread_create(&my_thread,NULL, void *(*start_routine)(void*),...
what's "factory" ? Try using arraystack.top instead of factory.top.. :confused:
make your own database tool like sql in C.
Or maybe there is hope here
and here
Thanks for helping!
First Ill try this multithreading in Linux environment. But all I get searching google is some man pages. I want a tut. Or a book. I got B.W.Kerringan an Denis Ritche book-The C programing language...
MadGuy, don't discourage people to learn C++. The code that you showed for window making in C++ can easily used as a template in another header. Like you import stuff in C# and Java. Open those...