19,876 Topics
![]() | |
I'm having problems with my do/while loop. It does not take the condition and simply continues the loop indefinitely. I have: [code=c] do { printf("Choose the base of the number to convert:\n\n"); printf("2 5 8 10 16\n\n"); printf("Enter option:"); scanf("%d", &baseFrom); system("cls"); if(baseFrom != 2 || baseFrom !=5 || baseFrom … | |
Hello everyone. Like so many others, I am new to programming. I am taking a course on Programming in C, and have hit a number of speed bumps. The assignment I am currently stumped on is: Let [I]arr[/I] be an array of 20 integers. Write a program that first fills … | |
Hello everyone! I've started a project on SF.net to create a small yet modern IRC client (µIRChat or simply µIRC). However, there one thing that I really can't decide before I start, and that is the language to use. My idea came from µTorrent, which is, as far as I … | |
guys, what do you think is the best compiler for beginners in C++? actually we are asked to make a game in C++. we are now using Dev C++, but we can't find a graphics library in it. thanks. | |
Hello everyone, I am trying to devise a Binary Tree Representation of a Postfix Expression. I am sure I am in the right track, but there's just something wrong in my code which I cannot find. I am just wondering if you guys can spot where I made my mistake. … | |
hello friends can u tell me how to find greatest of three nos using bitwise operators? | |
Write a calculator program that lets users enter a simple mathematic operation and display the results as in the sample output shown below (bold text indicates user input). Calculate: 92+1 Result = Ninety Three Calculate: 92, 000 + 1 Result = Ninety Two Thousand Calculate: 92, 000.01 + 1 Result … | |
Can someone help me with this program.I had found that the output of this program should be the local time and display time and date and i dont know where my program gone wrong and display like this time is 03:29:30 date08/06/[COLOR="Red"]1[/COLOR]08 how to eliminate 1 from my program.it should … | |
Hello, i just started with on my new school and we are going to make an application that ask how old you are. If you're 13 to 19year old it should say ''Teenager'' But if you write for example 8, it should say '' little kid ". I started to … | |
Hello, Need pointer on how to create a for loop within gdb that will print something each repetition to a file so that I can view results. How would I go about doing this? | |
Hi there I have a problem creating a slot machine game in turbo c++ because I cant get the value of the randomize number.... | |
Hi everyone, I'm having issues while attempting to read a text file of the following structure [QUOTE] 0 0 -7.278289 0 1 1.922087 [/QUOTE] As you see the first and second values in a line are integers, I'm not interested in those, the third value is a float which I … | |
Ive written the following simple code to find the addresses of the varialbles [code=C] #include<stdio.h> int main() { int a; int b; char c; float d; printf("\nInt : %x\nInt : %x\nChar : %x\nfloat : %x",&a,&b,&c,&d); return 0; } /* OUTPUT Int : 12ff4c Int : 12ff48 Char : 12ff47 float … | |
i just ended up getting the Virus Alert! icon right next to my time in the task bar, i cant open my c-drive when i try to CTRL+ALT+Delet it says the Systems Admin took that abbility away from me, yet im the admin for my pc, i cant get to … | |
[code=c] #include<stdio.h> #include <stdlib.h> #include <time.h> #include<conio.h> const int LOW = 1; const int HIGH = 150; int main() { int grid[30][30]={0},x,j,i,die; int data_points, tempx, tempy; for(x=0;x<150;x++) { tempx = rand() % 30 + 1; tempy = rand() % 30 + 1; data_points = rand() % (HIGH - LOW + … | |
Dear all, I am trying to print out some outputs defined by my own in different function calls and classes into a debug file, I saw in one source code using macros like: #ifdef DEBUG_OUTPUT #define debug2 printf #else #define debug2(arg1,...) #endif and with a call to this macro like: … | |
The following program is to produce the sum of Even and Odd array element. The program works properly when I use int instead of double. But getting errors when using double. Could anyone tell me what is the problem? Cus I wan it by using double array. and I don't … | |
Hi everybody, I want to write enter in a text file. How to do this. I wrote the code as follows. see if i write like this, it is printing one special character like arrow. I want to print in the following line, instead it is printing in single line … | |
I am currently working on a program that takes input from a file and calculates the averages. I decided to just write the program they way I "thought" I could do it. [code]struct student{ char name[15]; double average; double score1,score2,score3; }; struct student num_students[50]; int main (){ int i = … | |
hello, A small doubt regarding the context related functions.. I did a makecontext to create a new thread. ( C program) But in order to execute it,I need to know the main parent thread so that I can swap both. How do i know the parent thread..? i want to … | |
I'm trying to read from a text file multiple times but I only seem to be able to read the data once. Any advice would be greatly appreciated. [code] string input; while (!ifile.eof()) { getline(ifile,input); cout << input << endl; } while (!ifile.eof()) { ifile.get(ch); cout << ch; } [/code] ![]() | |
hey everyone, this is shafaq... i need help plz..i'm a student...i need some one to make a progrm for me in C language of a personal assistant..in that you hv to include appointments, reminders, to do taskjs, list of clients etc... plz i rele need help and that also soon.. … | |
hi everyone, how are you! i need a c program to read a Segy format file. i hope that the program can output the trace header and seismic data information in ASCII format, who can help me ? Thank you very much! | |
In [code=c] int main(int argc , char *argv[]) [/code] What could be the maximum length of string in argv ? | |
I have input files like this a.iup b.iup c.iup....... i have these input files in a variable called fname; like this char *fname="c:\\iupfiles\\a.iup"; every time i will get file name in this variable. But how to concatenate the variable with some other name like as follows in output file name. … | |
somebody please help me to correct this coding program [code=c] #include <stdio.h> void readmarks (int* num1,int* num2,int* num3); void grademarks (int num1,int num2,int num3,int* num4,int* num5,char* grade); void printmarks(char grade); int main ( void) { int num1; int num2; int num3; int num4; int num5; char grade; readmarks (&num1,&num2,&num3); grademarks … | |
Hello , I am trying to create threads using makecontext function. The code is sth like this.. [CODE=C] #include "mythread.h" #include <malloc.h> #include <stdio.h> #define FIBER_STACK 1024*64 int mythread_create(mythread_t *new_thread_ID, mythread_attr_t *attr, void * (*start_func)(void *), void *arg) { // Get the current execution context mythread_t t2; t2 = (mythread_t)new_thread_ID; … | |
I having trouble... for some reason strcpy(b,a) is not working... it says b is not identified [CODE]#include <stdio.h> #include "simpio.h" #include "genlib.h" int main() { string a, b, c; printf("Please enter a word: "); a = GetLine(); b = strcpy(b,a); b = strrev(b); if(strcmp(a,b)==0) { printf("\n%s is a palindrome\n",a); } … | |
Hi guys , i m doing a programme that can read a text files that contains number, student's ID,1st exam and final exam marks and it can calculate the total of 1st and final exam in order to grade the students. the programme then prints out the calculated total marks … | |
My problem is this, whenever I give this code an input of <!--, it always runs it through the tag definition first that I made, instead actually i want it to run through the <!-- in the rule part that I made (the one that BEGINS S1 after that), how … | |
Hi, everyone! I want to make the user authentication for mysql database. I write the code and test it, but can't run. Let's I talk about my project idea first. I have a server, a client and a mysql database. Before entering the server, the user must login first, After … | |
Make a program so that the function main is merely a collection of function calls. Your program should use the following functions. a. Function openFiles: This function opens the input and out files, and sets the output of the floating point numbers to two decimal places in a fixed decimal … | |
I have been using GSL, but I find it very awkward to work with. Does anyone have a recommendation for another one to try? I can't seem to find any on google. Thanks, David | |
hello i want to write a programme that creates (lets say) 700 folders and numbers the from 1 to 700 and if its possible to take contents from a txt file to put after the number... if anyone can help me get started it would be gr8 i just never … | |
hi.. :) i'm a first year college student and just starting with turbo c. We have a project that is to be pass on August 29. I hope someone can help me cause i'm really having a hard time with this. I have to make an exe. of the program … | |
hello, I used to type my programs on console application.by C language and use these libraries , <stdio.h>,<conio.h>,<stdlib.h> .etc and used these function (printf),(scanf) under <stdio.h> library.. but then I wanted to know how they make programs on windows application by C language . I figure out they used another … | |
hello , before 5 months I made a program by c language by borland c++ compiler v 3.1 . and it was run on console application.(dos). so. now i would like to make GUI program by vc++ 6 and this GUI program have a botton and when i will press … | |
Hello, I have problem to understand the code below: [code] #define LCD_DATA_REG (*(unsigned char*)( 0xC000 )) // Data Register #define LCD_CTRL_REG (*(unsigned char*)( 0x8000 )) // CTRL Register [/code] I know basics about pointers and I know how to understand pointers to functions, arrays, structures, int, ... However I don't … | |
The same source code is compiled with g++ (linux) and with visual c++. I found that the program runs much slower on the second one (0.03 seconds vs 0.359 seconds). The program uses <vector> and does a convolution: [CODE] void DSP_fir_gen1 ( vector < double > *x, double *h, vector … | |
Only C is the programming language that enables us with a high execution speed of programs among all other languages | |
I cant find whats wrong to this program... im new to C... Please help. [CODE]#include <stdio.h> #include "genlib.h" #include "simpio.h" #define size 5 #define size2 3 void getArray (int numbers[][]); void checkArray (int numbers[][],int space[][]); int main() { int numbers[size][size], i, c, x, y; bool space[size][size]; for (i=1; i<size; i++) … | |
Hello there! I've built a simple server and a simple client in C (Linux). Among other tasks, I need the server to send the timestamp (using time.h) to the client. Then I need the client to change the system time based on the timestamp received from the server. What would … | |
hey guys, I would like to make a menu like this: MENU [A] - Addition of binary digits [B] - Subtraction of binary digits my option: [U]A[/U] [CODE]printf("Input upper addend: 1110"); printf("Input lower addend: 111"); [/CODE] sample output: sum is: 11111 ...how can I make it like that? ![]() | |
i am trying to take a input from user , suppose if user types "a bat and a ball and stick" if my array is [ICODE]data[10][20][30] = { {"a","and","apple"}, {"bat","ball"} };[/ICODE] from the sentence how i can count occurrence of "a" in the sentence ( ie , from users input) … | |
Hi. I am taking my first C class and I seem to be having trouble with this program. The problem is: Write a function that adds two polynomials of at most degree n. /* f = g + h; n is the max degree of f, g, and h */ … ![]() | |
Hi all, I am new to C programming and need some of your help. I am trying to convert a string(ex. 25,000) to an integer. I use the atoi function to do the conversion, however, it only reads the initial portion of the string by stopping at the first non-numerical … | |
Hey I have to make the game War (card game: [url]http://en.wikipedia.org/wiki/War_(card_game)[/url] ) in C. Im not sure where (how...) to start. My basic thoughts/ideas/etc: Its a 40 (4 times 10) card version with 2 players. A way to do it would be set up a structure with 4 faces values: … | |
can any one tell me what are compiling errors and what are linking errors | |
I have to design a parser to convert Binary(HEX) File into number. I have to refer a format file for the same which is as follows: (Sr No;field_name;position;length;datatype;flag;) 1;TimeStamp;0;4;HEXA;0; 2;TimeOffset;4;4;HEXA;1; 3;Data_Vol;8;4;HEXA;1; ................so on.........it has 60 fields, which represent 1 record. Binary file: 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 Can you please help me coding this … | |
Hello guys this is my code. [CODE] #include <stdlib.h> #include <stdio.h> #include <string> using namespace std; void charToBinary( char *value ) { unsigned int i; unsigned int alloc = (strlen(value)+1); int* cVec = (int*)malloc(alloc); for( i = 0; i < strlen(value); i++ ) { //works in windows but not on … |
The End.