19,876 Topics
![]() | |
[code=c] #include <stdio.h> #include <math.h> void getTerms(void); int getPattern(int* term1, int* term2, int* term4, int* term5); void patternAdd(int* term1, int* term2, int* term5); void patternMultiply(int* term1, int* term2, int* term5); int term1; int term2; int term3; int term4; int term5; int test1; int test2; int addval; int multval; int main(void) … | |
Hey guys. I need some help on input validation in an array. The program can only input numbers but not characters. This is the code for the input. ( I know im a newbie lol ) [code=cpp] const arraysize = 10; float num[arraysize]; for ( int i = 0; i … | |
Basicaly I want to see if a a number (in my example: 12345678910 ) contains another, smaller number (1234). For this I decided to turn a into a string. For some reason my "in" function never worked. But now for some reason if I ever decide to invoke, there's a … | |
i have two questions right now in my mind : [B]question - 1 :[/B] please have a look at this code : [CODE]void function (int recd) { printf ("%d", recd); } void main() { int p=10; function(p); }[/CODE] here...when p is passed to function, the thing that actually takes place … | |
Ok... I did 3-4 project with your help. I have got now three 100 grades and I am so happy thank you all :) But now I have a huge problem... My new project is mess....... [COLOR=#000000][/COLOR] [COLOR=#000000]"""You are been asked to prepare the creation of a pseudo-random number generator. … | |
Hello!! I am using Keil Compiler C166. I want to know how much ROM, RAM has been utilized by the code. Can someone help me for this? | |
Hi there, I'm becoming increasingly confused trying to implement an array of pointers, that themselves point to nodes in a linked list. Basically my problem is that I need to sort through an existing linked list per element, over all other elements (which works fine) based on a particular criterion, … | |
Please forgive me, I know *VERY* little about C... I can hack out enough to do what I need to do for the most part but I'm absolutely lost on a project I need to finish. I am writing a wrapper for common RHEL commands so that our helpdesk technicians … | |
hello, Can any one tell me how to print the patter [CODE] * *** * for n =1 ** **** **** ** for n = 2 *** ***** ***** ***** *** for n = 3 [/CODE] the code i am having is [CODE] for(i=0;i<=n;i++) { for(j=1;j<n-i;j++) putchar(' '); for(k=0;k<=i;k++) printf('* … | |
Hi, Recently I have a text file which contain a bunch of numbers :- 1,0,0,1,0................ 1,0,1,1,1................ I would like to read these numbers line by line and stored into an array. However, I get seg fault for this. [code=c] char filename[5000]; char dump; strcpy(filename,argv[2]); while(!feof(tfPtr)) { for (i=0; i<16; i++) … | |
[code=cpp]#include<stdio.h> #include<stdlib.h> #include<sys/socket.h> #include<features.h> #include<linux/if_packet.h> #include<linux/if_ether.h> #include<errno.h> #include<sys/ioctl.h> #include<net/if.h> #include<net/ethernet.h> #define SRC_ETHER_ADDR "aa:aa:aa:aa:aa:aa" #define DST_ETHER_ADDR "bb:bb:bb:bb:bb:bb" int CreateRawSocket(int protocol_to_sniff) { int rawsock; if((rawsock = socket(PF_PACKET, SOCK_RAW, htons(protocol_to_sniff)))== -1) { perror("Error creating raw socket: "); exit(-1); } return rawsock; } int BindRawSocketToInterface(char *device, int rawsock, int protocol) { struct sockaddr_ll sll; … | |
here's what i have so far. I don't understand where exactly to put the (valid = MY_FALSE;) and the (badInput = MY_TRUE;) and the (valid = MY_TRUE;). [I]The directions state that:[/I] [B]Declare a contant for true, use 1 (MY-TRUE) Declare a contant for false, use 0 (MY-FALSE) Declare the integer … | |
| |
hello i have the following char *b2b_data_Out[1]={"0"}; The number "0" can change. I have a loop which goes round, and i have an integer value which i am going to use to change the above "0" into whatever value i need Question - How do i assign my integer value … | |
Hi all there is a Windows API function as [CODE]HANDLE CreateFile( LPCTSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile ); [/CODE] This function contains argument for share mode.. When I provide it 0 value then no other process can open/access the file already opened … | |
On C++ we have two different types of function which are non-returning value or void function and returning value function and what I would like to know under which condition you use either of those functions, and when do you know that you have to pass by reference(ByRef) or by … | |
write a program that reads the number of student from keyboard. Then it reads each students name, family name and average and keep these values in the memory. Then the program will sort students according to the choice of the user. You must also format the uppercase/lowercase according to the … | |
Hey I know this must be simple, but how do I prevent windows media player playing automatically when the form it is contained on is loaded? Thanks | |
Dear Friends, i am just a beginner with C and ma learning it since last 2 days. I found it very interesting. But what I want to do now is that i have to make a tool to filter a image with a low pass filter. does any one know … | |
Hello I have the following pointer char **pOutData; This contains an array of strings. How do i printf each element in of pOutData Hope someone can help best regards | |
Hey, I'm relatively new to OpenGL but I have a little experience in C and I was wondering how I would set the pixel coordinates of an OpenGL windows. Its a little hard to explain what I mean but for example if I would like to instead of having (x,y) … | |
I would have the help from any one to do the program for simulating the algorithms of page replacements in operating system concepts in any programming languages.If it is not possible to say ,please give me other assistance such as other web sites or other references for this as soon … | |
please i want help for the coding of page replacement algorithms implemented in c language | |
Thank you for your advancing helping. I do have a problem in how to encode a bank account that has : 1. account number,user name , intial deposit and balance (updatable) 2. that a specific user can see his balance 3. a user can withdraw money 4. a user is … | |
Hello, Is it possible that someone can help me with the following program? There are 500 light bulbs (numbered 1 to 500) arranged in a row. Initially they are all OFF. Starting with bulb 2, all even numbered bulbs are turned ON. Next, starting with bulb 3, and visiting every … | |
I have to do a code in De Morgans law show that 2 expressions are equivalent. I not even sure if I am going in the right direction. Can somebody steer me right original expression - ! ( x < 5 ) && ( y >= 7 ) De morgans … | |
could any 1 tell me why this code isnt working right?? two.txt is not wriiten good... this is the code [code=c] #include <stdio.h> #include <conio.h> #include <stdlib.h> #include <string.h> #define LEN 30 #define LENST 6 int *saveid[5]; char *savename[5]; unsigned *savegrd[5]; unsigned *saveavg[5]; int j=0,k=0; int min=0; int skip[6] = … | |
Hi I am kind of stuck on one aspect of a project that I am currently working on. I have a code for a number guessing game in "C" I need the program to ask the player if they want to play again after the game is done and. I … | |
Hi everyone. I have a quick question regarding a 2d dynamic array, and how to print it. Here is the code I have so far: [CODE] #include <stdio.h> #include <stdlib.h> #include <string.h> #define merror() {printf("Memory allocation problem \n");exit(1);} int main() { int i,j,k,z; int size; char buffer[21]; char buf[21]; char** … | |
Hey, I'm new to Socket Programming, and i've only learned C recently so probably what i'm asking will be very obvious, sorry in advance (= ok Here's my code [code=C] /* * File: Inside_Client.c * Author: Ghaith Hachem and Adel Youssef * * Created on March 17, 2008, 6:12 AM … | |
hi all. i need help... 1.how do i copy a line in a text file into a struct. 2. the text file i have is this: 10 SasonSasoniBenSason 100 100 5 Pinokio 70 90 20 JohnRambo 50 87 3 Elvis 3 77 50 JamesBond 17 1 40 BillGates 91 8 … | |
hello everyone how do i sort an array of 6 number with out using any type of sort and then printing the array sorted? i have a source text file with this numbers {10 , 5 , 20 , 3 , 50 , 40}. i copied the text file into … | |
im in new to c, i did this is some program and i used the math library, but i was wondering how is the math library available within the the system? and how can we find the names of the files that correspond to that library? Also, i read something … | |
i need to bind socket address and port for ipv6 programming... i canoot able to bind global ipv6 address by using normal bind command.... help me to bind ipv6 address and port number | |
Good Evening (Morning to others) I would like to find how it would be possible to create a calculator with only one entry field, i have managed to make one with two entry fields resulting in a ([2LeftOperand] + [2RightOperand]) calculation...i have tried hiding the Right Text box, and even … | |
Hello guys, can anybody explain to me whats a simple batch processing facility ? i googled it but i couldnt understand anything. thanks . | |
All I need to know is how to capitalize all of the characters of a string. What kinds of functions would I use? | |
can anyone help me convert my c program so it works on a linux system or mac? thank you. [CODE] #include<stdio.h> #include<math.h> #include<conio.h> #include<stdlib.h> int main() { int c; int a, b; char d; pov:system("cls"); printf("Enter the first number\n"); a=getch()-48; system("cls"); printf("Enter the function:\n"); d=getch(); system("cls"); printf("Enter the second number\n"); … | |
i'm trying copy a string to another and adding space between the names but it show a warning c4700 and i don't know why??? [code=c] #include <stdio.h> #include <stdlib.h> #include <string.h> char *convert(char *string) { char *p=string; char *tmp; while (*string==' ')string++; while (*string) { *tmp++=*string++; while(*string >= 'a' && … | |
k hi every1, im kinda new to C++, anyways..this is an assignment for my college. im supposed create a program that displays the username in a "creative" way. so first thing is do i use the get and ignore functions to get the initial if the user enters the whole … | |
Ive been trying to understand the below code for a while and need to know if it "acts like a record" for a single user. At the `end users[userdb]` is like an array for 6 struct user records? #define userdb 5 /* DataBase*/ struct user {char username[10]; char userid[9]; char … | |
Alright so.... i have logic errors in my game... and idk how to fix them... can i get some help?..... this is a project due for school... tonight midnight actually... and i'm afraid that if i post my code online that... they'll void my program for plagirism x_X'''... so.... ya … | |
Hi guys, Okay so this time I need help with string input. I have the whole program (yet again) but I just need to figure out how to change letters of user input to redisplay them. The code is below and it asks the user to input the product description. … | |
hi there.....i wonder what's the difference with these 2 linked list... [code] 1. struct node { int wage; int hours_worked; int salary; int hoursW; char* name; struct node *link; }; [/code] [code] 2. struct listNode { char data; struct listNode *nextPtr; }; typedef struct listNode ListNode; /* synonym for struct … | |
How does gcc order bitfields on a little-endian machine? Is the first entry the most significant bit or what? | |
i've done all the coding, but it doesn't work, seem the if, cannot pass the information to the function.. [CODE]#include<stdio.h> #include <string.h> #include<ctype.h> #define FILENAME "ECE.txt" /*void proceed(struct registration com, int matric); void again(struct registration com,int);*/ struct registration { char code[10]; char subject[100]; int credit; }; int main() { int … | |
Write functions to: void clearscreen(void); /* Clears the screen for update, hint call system("clear") */ float calc(float num1,float num2,char operator); /* calculate the result of num1 operator num2 */ any other functions which you deem necessary. Write a main program which will display a title line centered at the top … | |
Is it possible to add two hexadecimal numbers in C? If so, i would request someone to help wit the method or the logic asap. thank you :) | |
Hello again :) This time I'm back with a stranger question. The following program is meant to factorialize (spelling?) a number from the command line while printing out the number of calls it made to the function "factorial". [CODE=C] #include <stdio.h> #include <stdlib.h> unsigned long long factorial(int num,int *count_ptr){ printf("Call … |
The End.