19,876 Topics
![]() | |
Hello everyone, i am facing a problem with turbo c, when i complie and run the program, the screen just shows a blank black sreen, nothing is executed. you press any button on keyborad, the screen returns back to the editor mode. No program is getting executed, Found no errors … | |
Hi I was ask to do a code in c wich read the contenent inside a txt file and display it then after display it they wan't me to tokenize those command and interpretate them in c. I have no experience in c if someone can show me how to … | |
Hey everyone. I really need some help with my code for class. Here is the prompt : Write a program to manage a dictionary. The dictionary should be stored on a text file named diction.txt and consist of an alphabatized list of words, one per line. When a user enters … | |
hi i really interest in C game programming. i looked online for tutorials but they seem confusing. I am using c for one year, but i have no knowledge of game programming. could any one tell me where should i start and what is the best language for game programming. … | |
I was told to use bubble sort to sort the arrays. what i need to do is read in one array and have to sort into the other array but i haven't been able to figure it out here's the code i have so far. i've been trying to manuplate … | |
I am so confused on how to tell a run time of a algorithm. so i came up with some ex for me to understand. could any one tell me if i am find the run time right plz. ex1 - run time for this loop is O(n)? bc it … | |
![]() | ok so I had to do a program that represents numbers from different radix to some other radix... The part I got stuck is the following: i.e. I want to convert 123.625 (radix 10) to radix 3. The output is 11120.1212121212121212..... any ideea of a pseudocode/C code to detect whenever … |
hi Am trying to write a C-code that multiply two matrices but i want the elemnets of every matrix is random number using time function main() { srand ( time(NULL) ); int m1[10][10]; m1[10][10] = rand() % 10; scanf("%d%d",&r1,&c1); scanf("%d%d",&r2,&c2); if(r2==c1) { . . . . } this is the … | |
hi iam really interested in c++ game programming but i have have no idea how to get started and i have never used c++. i am using C and Java for about 2 years now. could any one let me know where can i learn graphic programming, game programming, where … | |
Hello everyone!! I have a problem about memory allocation, i use calloc() to initialize all elements in array to be zero. This is my code: #include <stdio.h> #include <conio.h> #include <stdlib.h> #include <time.h> #define sizes 1200 main() { double** arr; int m[sizes]; int i,j,k; srand((unsigned)time(NULL)); arr= (double **) calloc(sizes,sizeof(double*)); for(k=0; … | |
i need help finding the low value in an array after reading file with numbers. With my program I am to assume that the size an array is 100 even if only 10, 31, 50 spaces are taken up. The problem im running in to is when i iniztialize the … | |
Hello. I am trying to accept a paragraph from the user in C using codeblocks. But, with the scanf statement, the program stops accepting once i hit space. Is there some way to get around this problem? | |
I am trying to compute 2x-x+4x, so the answer should be 5x. but i am not sure how to get started. The "x"'s are messing me up. I am thinking of using for loop and replace x with '\0'. and than add or sub starting from left to right. but … | |
hi.. lately i had this problem when i try to build in codeblocks.. Debug" uses an invalid compiler. Probably the toolchain path within the compiler options is not setup correctly?! Skipping... Nothing to be done. and i tried to install it again and again with different versions.. but it still … | |
Dear All, I am trying to write to a file as below. But my file shows empty what could be wrong here? const char *dataFileName = "data.dat"; FILE *ftdata = fopen(dataFileName,"a+"); fwrite("TEST",1,2,ftdata); | |
#include<iostream.h> #include<conio.h> void main() { int z[33]; clrscr(); cout<<"Enter any Password (32 character max): "; for(int i=0;i<33;i++) { z[i]=getch(); if(z[i]==13) { break; } cout<<"*"; } cout<<"\nYou entered : "; for(int j=0;j<=32;j++) { if(z[j]==13) { break; } cout<<(char)z[j]; } getch(); } | |
Hello.Got a problem with a binary tree again,i have made a visual printing but the problem is that it prints only completed tree,so if it is not full it crashes,is there a posibillity to add some extra print to value NULL,so after one right or left leave won't have value(NULL) … | |
How can we convert a string to int without a standard lib the string termination can be '/r' | |
i need help with merge sort. struct List_A { int data; struct List_A *next; }; struct List_A *head; void merge_sort(struct List_A *); int main(void) { ....lets say i have a list build --- (list_A = 4,3,2,5) merge_sort(List_A); } void merge_sort(struct List_A *head) { struct List_A *cur_one; struct List_A *cur_two; if(head … | |
Hi all, Having a little trouble with assigning values to an array within a C struct. Unfortunately i cannot assign a size to the array as i am reading values to an array to be stored, and the size is relative to the other values in the struct passed to … | |
how do you insert in linked list. this is that i have. struct node { int data; struct node *next; }; struct node *head; void insert(struct node*, char*, int); int main() { int data; struct node *List_A = NULL; insert(&List_A, %data); return 0; } void insert(struct List_A, int data) { … | |
I was trying to assign values from a txt file to my program with the following code: #include<stdio.h> #include<conio.h> #include<string.h> int main() { float c1, c2, c3, c4, c5, c6, c7, c8; char d1[4], d2[4], d3[4], d4[4], d5[4], d6[4], d7[4], d8[4]; FILE *rate; rate=fopen("rates.txt", "r+"); fscanf(rate, "%s%f%s%f%s%f%s%f%s%f%s%f%s%f%s%f", &d1, &c1, &d2, … | |
Can someone guide me how can I use scanf for a structure? [CODE]const int IDLEN = 30; const int POLARITYLEN = 3; const int MAXSTOCKITEMS = 10; struct TransistorRec { char manufacturersID[IDLEN]; char polarity[POLARITYLEN]; float power; float gain; int stock; }; typedef struct TransistorRec Transistor; struct StockRec{ int size; Transistor … | |
Hi everyone. I have a UI Design that I got coded by my software developer and when I change the color of an image and then run under "debug" The image stretches even though I never changed any dimentions or anything. All I did was change the color.Any ideas what … | |
Can someone help me make a code for a username and password program where the usernameand pass is stored in a txt file. I've tried many things but I still can't make it work. The text file in question has the username password and user type separated by tabs and … | |
Help me please to find the problem in my code: Here is the error that I'm getting: serg@serg-PORTEGE-Z835:~/c$ gcc string_finder.c -o string_finder string_finder.c:4:5: error: conflicting types for ‘getline’ /usr/include/stdio.h:671:20: note: previous declaration of ‘getline’ was here string_finder.c:22:5: error: conflicting types for ‘getline’ /usr/include/stdio.h:671:20: note: previous declaration of ‘getline’ was here … | |
I'm looking for feedback on my code. I wrote a custom memory allocator (out of pure boredom) that is faster than the STD one (malloc, free). It's pretty simple in the way it works, it has a base block of memory which is where everything is allocated from, and it … | |
Hi friends! I'm new to libcurl programming in C. I cant find any libcurl tutorial on the web.Also i tried [the official one](http://curl.haxx.se/libcurl/c/) but i cant understand it because its not elaborate. So please help me with the tutorials/resources on libcurl programming in C. Thank you. | |
hi guys!! The purpose of the program I am trying to do is to have an input number of 6 digits typed in and this should then be printed as an hour minute second format. for example 123456 would be 12:34:56 This is what I have but it isn't working … | |
I've an application build with C# and WPF, that is being developed by 3 developers, including me. On a certain stage of the application, an error came up that we can't determine how it happened and how to solve it, so we ask for your help. Although everything works well … | |
actually, i don't know where to post this thread. but i know the people available on daniweb.com have much knowledge. will you please tell me that how to start writing proposal. i have spend 2 full days on PC reading about G-SOC but still i am not getting how to … | |
les say we have a binary file. and 1st letter is 3. how do i take 3 and put it into a char ar[]. what i did was if(fread(ar, 1, 1, fine)) { } | |
The problem I have and can't understand is that I receive a segfault when trying to close the second file (fclose(ofp)). Input file is a xml file that will generate food for output file. At present time, input file is being read for parsing but no output for outfile is … | |
actually, i want to calculate 2^60000 in 1 second. i have tried a way but it is giving output in specified time for 1000 power only.(i have used arrays to store a one integer). will you please give me a hint only how to do that ? [B][I][U]"I AM NOT … | |
Why is it that this won't work instead of using atoi ? `Inline Code Example Here` #include<stdio.h> int main(void) { printf("%d",(int)"10"); return 0; } | |
Hi. I have this problem with a Windows Form Application. I'm working with the Client, the server is already working and tested. If you look at this code: void WaitForMessage() { bool dropserver = false; while(dropserver == false) { char inputmessage[250]; int bytes = recv(sConnect, inputmessage, sizeof(inputmessage), 0); if(bytes <= … | |
char *ar[5]; //Array of pointers let say char * ar[5] contain: ar[0] = "cat"; ar[1] = "desk"; ar[2] = "desk" ar[3] = "zoo"; ar[4] = "cat"; how i want to get of any same strings. so in end ar should have the value "cat","desk","zoo". this is what i have so … | |
I would like to find out what this code snippet does. i know it involves extraction from a webpage format gb2312 but can ano\yone explain line by line, i appreciate the help... :) Code blocks are created by indenting at least 4 spaces ... and can span multiple lines if … | |
I am working on a recursive flood-fill function with 4-connected neighbours as part of a drawing application program. However, my attempts keep resulting in the program crashing. I am coding in C, however I will just post pseudo-code of my algorithm. I am hoping somebody can help me see what … | |
hi, i have a small problem with my program: int main(int argc, char *argv[]) { int ende; int modus; short x; short y; mkdir("maps"); while(1==1) { cls(); //some printf's char enter=0; while (enter != '\r' && enter != '\n') { enter = getchar(); } system("cls"); ende=0; modus=0; //some printf's scanf("%d",&modus);fflush(stdin); … | |
hello, i wanna ask if somebody can help me with this problem. First code: #include <stdio.h> #include <stdlib.h> int main(int argc, char* argv[]){ if(argc>1) { int i=1, zmnozek=1; zmnozek=atoi(argv[1]); for(i=1; i<argc; i++) { zmnozek*=atoi(argv[i]); }; printf("Rezultat: %d\n",zmnozek); }else { printf("Nepravilen vnos!\n"); }; return 0; } And there is the problem: … | |
Can someone please answer this for me as i cant do this practice question Thank You.  | |
I have been trying to explore the source code of the getcontext() and setcontext functions but I have not been able to spot the right file or resource. Any help in this regard will be helpful. I was able to trace to http://fossies.org/dox/glibc-2.14.1/setcontext_8c_source.html but there is no info | |
[CODE] #include <iostream> #include <string.h> #include <ctype.h> using namespace std; void RemoveSpaces (char *str); void Removevowels (char *str); int main() { system("Color 1A"); char myString[300]; char clear[300]; char cipher[300]; int selection; int x = 0; int i = 0; int opt; cout<<"Enter a string!"<<endl; cin.ignore(); cin.getline(myString,sizeof(myString)); cout<<"Plase select what you … | |
Is it possible to convert Float or double in a string??? Any idea?? | |
Hi, I want to know what is meant by a code footprint. I tried googling but all of them have explanations that I was really not able to understand. Can anyone please tell me what is means? How is it important and how can it be used(if at all it … | |
Hi there, I've been learning C lately, and in one of the exercises I've encountered a bit of a frustrating issue. The exercise is to accept a string of characters that are answers to a multiple choice quiz, and then compare them to the correct answers which are in another … | |
Hey, how do you declare an array of strings using double pointer ? I normally use [CODE]char* str[] = {"this", "works", "fine" ,"for", "me"}; [/CODE] But I want to know if there is a way of declaring array of strings using something like [CODE]char** str; [/CODE] Please show me how … | |
cHey guy can anyone help me to solve this question because i am begginers i am so sure to use array C++ write a program to find smallest of 30 integer using array Thanks |
The End.