15,551 Topics
| |
hi eveRyone, I just want to have your tips for my code.. [CODE] #include <stdio.h> main() { hexa = 16; printf("enter decimal number: "); scanf("%d",&deci); for (ctr = 1; ctr<=deci; ctr++) quotient = deci / hexa; printf("Equivalent in Hexadecimal is %d",quotient); getche(); }[/CODE] I want to print out the numbers … | |
A Ternary Tree (T) is a tree in which every non terminal node has at most 3 children. We will use T to simulate the following activity: A set of P candidates must pass a set of exams ordered in an array of N exam codes (an exam code is … | |
I declared one variable in one type (say char x ) and allocated. But i'm assigning integer or some other type value to it. Below is the code snippet which i'm facing problem, char *tempstr = (char*)calloc(1,4); // declaring with char variable tempstr[0] = '2'; // trying to assign 5 … | |
Hi, I have graph in C. I enter vertexes and edges with price. Now I would like add path, where I visit only few of the vertexes and then I would like to print this path. I don't know how to do it, so I am asking you here.... | |
Why dont we use '&' in the case of strings in function scanf ?? e.g. :- scanf("%s",date); here date is a character arraymeans string. Plz help | |
I made a new project that has to open a folder using DIR * `DIR * directory=openDir(...); // openDir is a function returning DIR * after it was opened` than to make a new folder in it, so far so good `mkdir(path,permissions);` and now i have to run through the … | |
Hi, I tried to do like below, but its not printing the expected one. Plz suggest to proceed further. OUTPUT: Enter the string: abc Entered string is : NULL void main() { char *a; printf("Enter the string: "); scanf("%s",&a); printf("\nEntered string is :%s", a); getch(); } | |
I am trying to store the permutations generated by the recursive permutation function so that I can use them in main; however, I cannot figure how to get them to store correctly. I.E. when I run this function with a string AB, inside the recursive AB and BA gets printed … | |
I'm using VC++ 2010 with Windows 7 x64. I'm compiling all my code as C code. I have a for loop like this: for (i = 0; i < max; i++) { ... } But when I run it, `i` is being set to `max` If I set `i` to … | |
I ve to sort an array according to finish time and accordingly start time should be arranged, how can we do this using predefined function qsort. Both Start time and finish time, i ve considered it be in a structure , .here is the code.. #include<stdio.h> #include<stdlib.h> int compare (const … | |
The code is as follows and I wanted to know more about how and where \v and \f are used? printf("Vertical tab \v is tricky, as its behaviour is unspecified under certain conditions.\n"); Also, can anyone explain what the sentence in the print statement suggests? | |
hi there!here's the problem in a nutshell: there are 2 files.the program creates 2 processes: the parent process outputs text lines from the 1st file and for each one of these lines the child process outputs relative info from the 2nd file. e.g. <1st line from file1> <relative info from … | |
| **Hello folks!** i am using DEV C++ to code now i am working at a game in console and i have a problem with the *_setcursortype(_NOCURSOR);* function i set it but the cursor is still like *_NORMALCURSOR* in Turbo C works perfectly in DEV not ( i tried to set … |
Dear all, I am trying to read a list of string from text file and put it into an array. Could anyone tell me, how to split that string to array. Here's my text file.... [I]text.txt[/I] a b 1 2 4 2 3 1 *3 1 3 *4 4 4 … | |
Hey, Im having problems converting an integer to a character , it seems to either produce incorrect results when printed(usually some sort of ascii symbols) instead of the actual literal value. char* str; str = (char*)malloc(sizeof(char)); snprintf(str, 16, "%d", remainder[i]); cout << str; This is what im currently trying, but … | |
**Hi every body i m new to the computer science i dont know how to get started with C my friend advised me to creta account here so i do . i hope that u people will help me to cope up all the facts about C and C ++.** | |
my_funcs.c: int x = 0; FILE *stockIngredientes = fopen( "C:/Dropbox/Work/ISEC/P/ingredientes.txt", "r+" ); while( fgets( tmp, 100, stockIngredientes ) != NULL ){ ingredientes[x].nome = strtok( tmp, ":" ); ingredientes[x].identificadorNum = strtok( NULL, ":" ); ingredientes[x].quantStock = strtok( NULL, ":" ); ingredientes[x].limMin = strtok( NULL, ":" ); ingredientes[x].consumoMed = strtok( NULL, ":" … | |
This is the program to print all possible combination of the string. It was orginally written in C++. Now i'm trying to write it in C but stuck with this problem of strings and pointers + some warnings. INPUT is taken from argument, which is "const **char" . I tried … | |
Hi to everyone, this is my first post in this site. I hope you'll be able to help me with mi little issue, as I've been trying to solve it for hours without results. The question is simple: I have a text file, and at the end of it there's … | |
Hi... I converted a basic adding program from matlab .m function file into .c & .h file. When i try to include the header file function "add" into my main function in dev-c++ 4.9.9.2 --- [Linker error] undefined reference to `add' is the error message on compilation. Here is my … | |
hello everyone i need help with an assignemnt that askes me to read from a file and count the number of occurence of each letter in the alphabet . im stuck trying to group each letter in an array. i think using a switch statement would be the easiest way … | |
I am getting a crazy number of errors that i honestly do not know what is wrong. I am getting a syntax errot before the "int"s in the switch, and conflicting types of all the function names. Any help will be appreciated. #include <stdio.h> #include <stdlib.h> #define ARRAY_SIZE 241 void … | |
Hello everyone, I am sort of new in C programming and since I programmed mostly in C++, I may have some mix up on my program which is giving me some errors. I have written a small code , in modular fashion i.e. I have split the .h, definition.c , … | |
#include <stdio.h> #include <mysql.h> #include <string.h> int main(int argc, char **argv) { MYSQL *conn; MYSQL_RES *result; MYSQL_ROW row; int num_fields; int i; char user_query[100]; char word[10]; printf("Enter word: "); scanf("%s", word); sprintf(user_query, "select * from english where word = %s", word); printf("%s\n", user_query); conn = mysql_init(NULL); mysql_real_connect(conn, "localhost", "root", "123", … | |
Hello everyone I am trying to create a MS word file using c programming can anyone tell me how to change the font size using c programming and one more thing i a creating this file through a embedded machine in pendrive. | |
Hey, please tell me how to find a prime number from dynamic array. | |
` Below Code not working :- #include<stdio.h> void main() { char *s; gets(s); printf("%c",s); } | |
Hi, Can somebody please explain , printing with structure variable also working. int main( void ) { struct bitfs { unsigned char a:4; unsigned int b:5; }; struct bitfs bf = {15,31}; struct bitfs2 { unsigned char a:4; unsigned int b:5; }bf2 = {15,31}; printf("a= %u \n", bf.a); printf("b= %u … | |
Hye i am running difftime tu different 2 time values, but unfortunately when i run on my laptop it does return values, but when i pass it to my friend the value returned is 0... and also when i run in windows the value returned also zero.. here is a … | |
i have previously created time using mktime and stored it in file, now the problem is how can i call it back and read as standard time, not an array. this is because i wanna make use of difftime function. here is my code sample: int ex(){ int typ; printf("\n\n\nEnter … |
The End.