Though I haven't tried out the code, on first look, I'm suspecting your char *data[k].
void execute(short k){
char *data[k]; /* as k is unknown while compiling, */
/* how...
Type: Posts; User: technam
Though I haven't tried out the code, on first look, I'm suspecting your char *data[k].
void execute(short k){
char *data[k]; /* as k is unknown while compiling, */
/* how...
Good work and great attitude, kasj!
Why do you need extern here, first of all?
Do you understand how the below program works?
#include<stdio.h>
void main()
{
int i=2;
do
{
if(i<3)
printf("Have fun...","\n");
Sorry, there is a small correction in my sample code. It struck to me just now. I gave that example without trying out (still did not try out!!), but the below assignment was what I had in mind when...
One common real life application of unions is, to use generate device handles or similar entities. Given below is an example, where an 8-bit demux handle is constructed bitwise, and once it is...
Hey, your recursive call coupled with if and increment is serving as loop only!
and in the first block also,
(x & ((~0 << (p + 1)) | (~(~0 << (p + 1 - n)))))
Please check the brackets properly, I think you are calculating it wrongly :)
return (x & ((~0 << (p + 1)) | (~(~0 << (p + 1 - n))))) | ((y & ~(~0 << n)) << (p + 1 - n));
Lesson learnt, thanks BEN10!You're welcome, zcrself!
I think the best option to solve the overhead of switching between release/debug build etc is to take a leaf out of the Linux kernel build system. Write the Makefiles in such a way that all .o, .a,...
To add to brewbuck's inputs, an alternative would be something like this (if you need just a small single Makefile):
BUILD ?= release # default build option
CFLAGS = flags common to all builds
...
Pardon me, I'm new to a forum of this kind. Lesson learnt, by the way!
OK, I change my tip to "start using a debugger" :-)
I'd like to add one more point. Do practise using GDB.
gcc -g sourcefile.c
gdb ./a.out
(gdb) b main [skip this gdb command if your program is big enough and you don't know where exactly your...
In case you are working on Linux, and all you need is to "figure out the number of columns and rows in these files", here's a quick command-line solution using awk:
To get the no. of rows:
awk 'END...
Please refer my post in reply to another question from you: why Segmentation fault?
I guess you are a bit confused with 1d, 2d, pointers and pointers to pointers! Since I see a double pointer, I assume you are intending to use a 2d array using pointers. And my post is based on this...