19,876 Topics
![]() | |
can i return a value using CHAR DATA TYPE? NOT INT? ex.int data; int value(ex.data) return data; how about this ex.char name; int(ex.name) return name; possible or not? | |
Hi I am fairly new to C and was wondering if anyone can help me out. I am trying to take a 2D array and scan for individual letters. I have a hangman game and the program takes a word from words.txt and assings it to the char word[20][30] For … | |
Hi everybody, I just start lerning C I'v heard a lot about pointers but not really sure were to put them. (or may be I'm wrong may be I just made some mistake) pls take a quic look. [CODE]/* This program will delete all simbols * from s1 that s2 … | |
Hi hwo to write total of 10 first setences (C languege) -1,+2/3,-3/5,+4/7,-5/9,... | |
I was wondering if anyone can assist me with a problem that I have with C Bluetooth programming (Linux Bluez). I am using Ubuntu 10.04, BlueZ 4.60. My goal is to have a L2CAP socket in which there will be minimal delay for sending data between 2 computers. So far … | |
Hello I have an experience in programming previously, and now i want learn C . how can i learn it, i means where i can learn it . in fact i am looking about sources to learn like books,web sites, and vedios. and i hope you Heuristic to the good … | |
i am starter in c/c++ i need to convert this: [CODE]cout <<" "<<ch1<<ch2 <<" "<<ch1<<ch3 <<" " <<ch0<<" "<<ch1 <<" "<<ch1 <<ch4 <<" "<<ch1<<" "<<ch3<<ch5<<" "<<ch0 <<" " <<ch2<<ch3<<" "<<ch1<<ch5<<ch0<<" "<<ch1<<ch4 <<"\n";[/CODE] in printf, but i dont know how to do it. | |
![]() | Hi, I am programming some console application that updates itself periodically from Internet. (windows.h + pthreads for win32) I want to do something like: [CODE] MAIN FUNCTION: create thread launch updater THREAD: infinite loop - starts the main application, exits if application ended normally but when it was killed by … |
By using an if statement how could i get a character to detect end-of-file. i was thinking something like this: [CODE] char a = '\0'; int count = 0; if(a == EOF) { count++; }//endif [/CODE] but it doesn't seem to detect the end-of-file. Any idea would be appreciated. Thanks … | |
[code] #include <stdio.h> int max(int x, int y); int min(int x, int y); int main() { int grade, total, counter, avg; total = 0; counter = 0; printf("Enter grades: (-1 to end list)\n"); do { scanf("%d", &grade); if(grade != -1) { total = total + grade; counter = counter + … | |
Hi, need help with an assignment. Here is the problem and the code the I came up with. It displays the start and the end but it does not display the numbers in between. Thanks in advance. ;) [CODE]//create a C++ program that will accept 2 numbers: (Start Number and … | |
Following is the one of code written by me for shared memory. Problem is that program donot come outside from marked loop and read numbers infinitely. "common.h" [CODE] struct common { int a[10],b[10],c[10],flag; }; [/CODE] p1.c [CODE] #include<stdio.h> #include<unistd.h> #include<stdlib.h> #include<sys/shm.h> #include"common.h" int main() { int running=1; void *shm=(void *)0; … | |
void ADD_QUOTE(){ do{ printf("\nPlease enter Length:\n"); scanf(" %d ", &length); }while(scanf(" %d ", &length)<200 || scanf(" %d ",&length)>4000); { while ((length[count] = getchar()) != '\n') putchar(length[count]); } return; do { printf("\nPlease enter Size:\n"); scanf(" %d ", &size); }while (size[count]<200 || size[count]>4000); do { printf("\nEnter which Board type you want: 'A'-4mm … | |
I am making a program to store all the powers of 2(1,2,4,8...) till 2 ^50000. Although I am getting the answer,I am not getting my answer in the required time limit. Any suggestions? How should I store the numbers? Here is my stupid code as of now [CODE] #include<stdio.h> #include<math.h> … | |
I need help figuring out how to count sentences from a .txt file. The following guild lines are what is considered to be a sentence: 1. A TERMINATOR followed by two spaces 2. A TERMINATOR followed by one space and end-of-line 3. A TERMINATOR followed by end-of-line 4. A TERMINATOR … | |
hello! how to make a program that replaces words in a file and replaces it with another word and saves it to another file. Using command line arguments.? | |
[code]#include <stdio.h> #include <stdlib.h> #include <time.h> # define clrscr() printf("\033[H\033[2J"); struct treeNode { struct treeNode *leftPtr; int data; struct treeNode *rightPtr; }; typedef struct treeNode TreeNode; typedef TreeNode *TreeNodePtr; struct queueNode { TreeNodePtr data; /* define data as a char */ struct queueNode *nextPtr; /* queueNode pointer */ }; /* … | |
Hello, I'm using pause() to suspend threads until I need them and pthread_kill(thread, SIGCONT) to resume. It works the first time over with the thread unpausing the first time I send SIGCONT, but not the second time around. Does sending the signal cause it to be ignored and if so, … | |
Hi all. I have this error and i cant figure out what is wrong here, i have tried to google and used a few methodes to c what is wrong but, naah, no luck. [I] pic 16f887 HI-TECH C Compiler for PIC10/12/16 MCUs (Lite Mode) V9.81 Copyright (C) 2010 Microchip … | |
Hey! I have some trouble with drawing on picturebox in visual studio c#. I want do draw a line between 2 points that i get either with mouse clicks or with inserting coordinates manualy. So i have created 2 events, picterbox paint event where i made a pen and graphics, … | |
Hi I am trying to validate a URL in-putted by the user to check whether it is syntactically correct. [CODE] #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <string.h> #include <sys/types.h> #include <regex.h> printf("Enter the website URL:\n"); fgets(str, 100, stdin); if (!strcmp(str, "\n")) { printf("Empty URL "); exit(2); } regex_t regex; … | |
I just have a quick question. Say I have a struct for the purpose of commenting in which it could be filled up or left blank depending on the user. Therefore, I need to dynamically allocate memory to the array comments. [CODE] typedef struct userComments { char comments; } name; … | |
I have been working on this all day can someone please tell me what I am doing wrong. using System; public class ArrayManagement { public static void Main(string[] args) { int[] myArray; myArray = new int[7]; myArray = fillArray(); int sum, avg; arrayMath(myArray, out sum, out avg); displayArray(myArray); } public … | |
hello all! i need help regarding my C programming homework of the Conway's game of life. i have to make a C program that will read a textfile containing a 25x25 matrix of 'X' or 'blank space' and will print its content. This will serve as the initial generation and … | |
I have a question, I have a working application. I am using a splitcontainer with multiple different Panels inside of it. When a user clicks a button the following code is executed: [CODE] this->panelnameA->Visible = true; this->panelnameB->Visible = false; this->panelnameC->Visible = false; [/CODE] Now my question is lets say an … | |
My simple Serial Port code doesnt work. Not sure if its my code, or my USB adapter. Can someone try it / tell me what ive done wrong? [code] #include <stdio.h> /* Standard input/output definitions */ #include <unistd.h> /* UNIX standard function definitions */ #include <fcntl.h> /* File control definitions … | |
to anyone I am currently writing this C# program for a C# class I am taking and I have the correct formula which is Future Value=PresentValue*(1=Rate)Year the issue I am having is there is an error message for the futureValue= presentValue, the presentValue has the message Use of unassigned local … | |
Hey forum, I'm very new to C++, and I need some help. I'm currently having trouble trying to write a Caesar cipher in C++. So far, I'm able to get it to read characters from a text file, and let it count the # each letter appears in an array. … | |
[CODE]#include <stdio.h> #include <string.h> #include <stdlib.h> int main(){ char name[80]; char *searchptr; int i, t; for(i=1; name[i]!=EOF; i++){ printf( "Enter name\n"); scanf("%s", &name[i]); } for(t=i; t<=0; t--){ printf(" name[%d] == %s", i, name[t]); getch(); return 0; }}[/CODE] | |
i hove a problem about hot to write a program to determine if a number entered by a user is a prime number. Program Input is : Prompt user for a number between 1 and 1000. the probable Program Output is: Echo the user input, display whether the number is … | |
Hi, I'm trying to define a dynamic array that consists of an email address and a home address. How can I define them dynamically using malloc() in the below struct? [CODE] typedef struct entry{ char name[40]; /* contains name */ char phone_number[9]; /* contains phone number */ struct entry *next … | |
I am trying to implement a program for finding the remainder on division of 2 numbers n2/n1 such that n1 is of the order of 2^32(having a few digits) and n2 is the order of 2^65536(having about 20000 digits) So far I have stored them in an array digit by … | |
![]() | I'm trying to create an array of structs, of which the array size is defined by the user in the program. eg. p[0], p[1], p[2]..... [CODE] typedef struct { int score; }player; void main() { int numPlayers; printf ("\nEnter number of players (1 - 4)\n"); scanf ("%d", &numPlayers); }[/CODE] The … |
Hey guys i need to color code [CODE] printf("hello World");//how do i change this to green printf("How are you");//How do i change this to yellow or something [/CODE] How do i change the color of the text inside the printf | |
hi, I recently wrote this code to calculate the hamming distance between any two binary numbers... The program accepts the numbers in decimals, performs a bitwise XOR operation and returns the HD... However, it returns the Hamming distance in decimal... that is if after XOR it gets something like 0010... … | |
Hello , I'm new here and new to c/c++ programming. Can you guide me how to extract user from path like : /home/[COLOR="Red"]user[/COLOR]/public_html Please help me , thanks a lot | |
String sQueryShow = "SELECT SUM(pf5_showplaylists.runningtime) FROM pf5_showplaylists WHERE pf5_showplaylists.showID = " + ShowID + ";"; HOW CAN I GET THE RESULT OF THIS SQL STATEMENT INTO A VARIABLE SO COULD DISPLAY THE OUTPUT IN A MESSAGE BOX? (URGENT, REALLY URGENT..) | |
Say I have a struct: [CODE] typedef struct entry{ char name[40]; /* Contains name */ char phone_number[9]; /* Contains phone number */ struct entry *next ; /* next is used to navigate through structures. */ } contact; [/CODE] I have a pointer: [CODE] contact *email, *address; [/CODE] In my main(), … | |
Hello, I am a beginner at programming and I am having some trouble finding the error in my code(pasted below). I am first trying to come up with a (1) function to evaluate integers at a given power.(2) A function to check if an integer is a perfect number. I … | |
I'm running the following in Eclipse using the Cygwin as the toolchain and the error code is executing. I get "cannot get params about stdin: Inappropriate ioctl for device". It's fine in Linux. I've been able to run other code that doesn't use this header. Also, how can I set … | |
Dear All, I have written a code to implement an algorithm for base conversion from decimal to any base between 2 and 36 given in RG Dromey. Below is my code and I have a few questions relating to it: [CODE] #include<stdio.h> #include<stdlib.h> int main() { int newbase,zero=atoi(0),q,ndigit=0,r,ascii,i; char newrep[100]; … | |
I'm a little stumped on a section of code in my program. I'm trying to take in a string of chars and then store each word within that string separately in an array of strings without using stdtok and then output them with only a single space separating each word, … | |
So i am making a piece of program In C but i cant get to check the system time and execute IF the time is equal to the systems time. in Plain english this is what my program is supposed to do. # # LIBRARIES # 1. Check the system … | |
Hi, I'm only starting my program and I already have this error but I really don't understand which ones are causing this shift/reduce conflict and why. Can please someone help me? it says I have 2 conflict shif/reduce. This is the grammar: [CODE]Start : Declarations/* put your RHS for this … | |
is this logic correct, where does counting starts in a link list, is it from 0 or 1. b'cos when i am ading item 60 at loc 4, den the output is : item number 1 contains 30 item number 2 contains 20 item number 3 contains 10 item number … | |
hello everybody, please guide me how to make the communication between two systems so as to transmit the message, using C programming language. thanks | |
[CODE]There is a single ring road that runs over the circumference of this circle and connects all the boarding points. There are also N - 1 different shuttle agencies available in Bhiwani. For every different boarding points A and B there is exactly one shuttle that connects these points and … | |
hello, I am a new learner of C#, I will like to know Which way is the best to learn, Either to use Microsoft Visual C# or Notepad? The book am using to learn make use of Microsoft Visual C#, and Also Please what is the Different between C, C# … | |
i create an applicaton in c# now i want to make a 1 clicksetup file that includes windows installer,ms sql server 2005 and ,netframewok. Sql server should be automatically configured to sql server authentication mode with a new user name raj and password 123. Plz help me guys | |
Hi! I'm new to C and I'm having some problems in my program. It opens a .txt file then copies this to another .txt file but replaces a certain word with another word. It uses command line arguments. Example: //inside text.txt love is patient love is kind ... ./change love … |
The End.