15,551 Topics

Member Avatar for
Member Avatar for campuzcrazyness

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 …

Member Avatar for bmsangati
-1
991
Member Avatar for bgraw

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 …

Member Avatar for bakabozza
0
215
Member Avatar for Perry31

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 …

Member Avatar for WaltP
0
258
Member Avatar for AnnA.A

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....

Member Avatar for Despairy
0
88
Member Avatar for vivekgupta143

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

Member Avatar for deceptikon
0
96
Member Avatar for Despairy

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 …

Member Avatar for Ancient Dragon
0
106
Member Avatar for Perry31

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(); }

Member Avatar for DeanMSands3
0
8K
Member Avatar for iAndrewMeyer

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 …

Member Avatar for VernonDozier
0
186
Member Avatar for tomtetlaw

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 …

Member Avatar for DeanMSands3
0
147
Member Avatar for cse.avinash

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 …

Member Avatar for cse.avinash
0
96
Member Avatar for sunfutbol

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?

Member Avatar for WaltP
0
175
Member Avatar for paranoidSandra

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 …

Member Avatar for paranoidSandra
0
121
Member Avatar for thendrluca

**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 …

Member Avatar for thendrluca
0
1K
Member Avatar for daffi_gusti

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 …

Member Avatar for Sokurenko
0
4K
Member Avatar for trishtren

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 …

Member Avatar for WaltP
0
387
Member Avatar for firdousahmad

**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 ++.**

Member Avatar for firdousahmad
-1
105
Member Avatar for mcjiwe

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, ":" …

Member Avatar for mcjiwe
0
138
Member Avatar for rhoit

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 …

Member Avatar for rhoit
0
362
Member Avatar for tuputavieja

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 …

Member Avatar for Sokurenko
0
117
Member Avatar for sriram_11

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 …

Member Avatar for sriram_11
0
381
Member Avatar for reyesg

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 …

Member Avatar for WaltP
0
104
Member Avatar for awesomeriley

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 …

Member Avatar for deceptikon
0
178
Member Avatar for robgeek

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 , …

Member Avatar for WaltP
0
352
Member Avatar for Anark10n

#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", …

Member Avatar for Anark10n
0
148
Member Avatar for rohit61288

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.

Member Avatar for myk45
0
144
Member Avatar for ManT
Member Avatar for Sokurenko
0
28
Member Avatar for nee_88

` Below Code not working :- #include<stdio.h> void main() { char *s; gets(s); printf("%c",s); }

Member Avatar for Sokurenko
0
120
Member Avatar for Gaiety

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 …

Member Avatar for WaltP
0
107
Member Avatar for wan632

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 …

Member Avatar for WaltP
0
707
Member Avatar for wan632

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 …

Member Avatar for wan632
0
112

The End.