Thnx! it solved my problem... :wink:
Type: Posts; User: greendragons
Thnx! it solved my problem... :wink:
Hello,
I am writing a program in which user enters number of coordinates and then coordinate values, and then it enters number of queries and then queries, here is the partial code..
...
nah it's working fine for positive values too... :D
Im writing a program where efficiency is very important as im dealing with large numbers, so branching will lead to slow running time, and here comes the bit hack to rescue, mine long long abs works...
Hello everyone,
I was searching for a way to get absolute value efficiently using bit level hacks, n found it's int equivalent, but i wanted it on long long so changed int to long long,
...
Actually im following a tutorial of ncurses, not sure about conio.h, all i now it's clrscr() and getchar()(guess im right).. :D
const char** is for constant pointer to a pointer which is of type char data, means that you cannot change values of array a, and btw %s is printing fine...
Why don't you use switch case for that, you can create a seperate function with switch case which checks for those cards and prints equivalent characters....
I know eof is int, it's just macro for int value, what im trying to achieve that i get every character of different(random) color..
What you are looking for is provided in C99 and C++, as C89 it is strictly static and array dimensions must be known at compile time...
Hello,
I am writing a program that reads a file and prints each character of a file in different randomly chosen color. I am using ncurses for that,
But the problem is that i cannot change color...
Thnx alot!! i didn't know that.... :)
Yes your right it should be strcpy... can u please explain me why i dnt need to cast return poiner of malloc as i have been doing it in lot of programs... wht is wrong with it..
I know we don't...
gosh!! how can i miss that.. thnx alot rags.... :)
here are the header file
#include<my_global.h>
#include<mysql.h>
#include<stdlib.h>
#include<string.h>
I think the malloc cast is fine as it returns void * and i need to operate on char *...
Hello,
I am writing a query for database
here is the code..
char *create_query(char *name, int perc)
43 {
44 char *defl = "INSERT INTO student_profile VALUES ('";
45 char *def2 =...
You are not getting wht i said... i know size of char * is dependent on architecture.... im here swapping addresses pointed by vp1 and vp2 in case of char string... so i need to pass char ** which...
I got it.. i missed &.... it should be swap(&s1,&s2, sizeof(char *)) and it's working fine... as memcpy operates on data pointed to by address.. so for char string i must pass char **...
And that...
Hello,
I have written a code to swap two variables of generic types....
I am able to swap numeric values correctly... but when i try to work with character arrays it is swapping but some characters...
LOL... i forgot tht sorry....
Now it's working.. Thnx!!
Hello,
I am writing a simple linked list implementation program... But im facing a problem in printing the contents of list, here is the code..
#include<stdio.h>
void insert(int value); ...