15,551 Topics
![]() | |
Hi all. I am new in C language. I am learning to program by using C for my first step. Now I am reading a chapter about looping (while, for, do.. while, nested loop). In my exercise book, the question is about to: Using nested loop to print out this … | |
Hello, I'm just new here. I wanted some people to help me with my project. We were tasked to do a game using Turbo C. I already found some games that has source codes like snake, tic toe, etc. I wanted to be slightly different 'cause I know my classmates … | |
I wrote this code : #include <stdio.h> int main() { int a,b = 10,c,d; a = printf("b is %d\n",b); c = printf("a is %d\n",a); d = printf("c is %d\n",c); printf("d is %d\n",d); // lose a null terminator in the previous strings ?? c and d // are 7, but a … | |
I have four array of strings. I would like to print out the strings with this formatting: printf(" %d \t %s \t %s \t %s \t %s.\n", quadruples_line_counter, strings_quadruples1_action[0], strings_quadruples2_variable1[0], strings_quadruples3_variable2[0], strings_quadruples4_temp_variable[0]); It gives this output: 17 func sub int 3. 17 param (null) (null) (null). 17 alloc 4 (null) … | |
Hi there. I've been trying to wrap my head aound this seemingly simple problem. I am write a game and I need to show on the screen the number of seconds the game has been playing for. This is the best way I can come up with but it doesn't … | |
Write a program that accepts five input values and stores them into an array. The program should then display the average of the five numbers. Finally, the program should display all the numbers in the array that are larger than the average of the five numbers. So I did the … | |
In the str char array below I would first like to locate the first math symbol I see, then I would like to count backwards and remove whatever is between the previous three " _ " and remove the three " _ ". Can I please get some ideas on … | |
How does this compile? I forgot to set my second condition in my second for loop and it compiles. if(cmp_str5 == 0 || cmp_str6 == 0) { if(cmp_str5 == 0 || cmp_str6) | |
Hi, I'm still a beginner for C programming. In my assignment I've encountered this problem and I know is a linker problem but I'm not sure how to solve it. I'm trying to link 3 files which 2 .c files and 1 .h file. Below are the codes for my … | |
Here is a small e-Book for your attention: [The Ultimate Question of Programming, Refactoring, and Everything](http://www.viva64.com/en/b/0391/). This book is intended for C/C++ programmers, but it could be of interest for developers using other languages as well. What makes the book peculiar is the descriptions of real, not theoretical cases at … | |
hello, how to setup eclipse IDE to use visual c/c++ compiller. i have visual studio express on my computer i guess this include c++ compiller what probably do compile c. so i would like to know how can i use the the visual c/c++ compiller in eclipse IDE thanks you … | |
I have some data in varbinary(max) from database and I have exported it to physical files. Some of these files were in jpeg so I was able to just add an extension .jpg to it and it opened. The rest are not jpeg files. **I have tried almost all the … | |
Hello Hello i have struct dynamic array (matrixCov) like this *array = (struct matrixCov*)malloc(sizeof(struct matrixCov) * counter); now i have another struct Link list with element Data type -struct matrixCov (struct matrixCov * data) now when i type this line for (k=0;k<conter;i++){ (*pointer)->data =array[k];} when k=0 copied well but from … | |
1. Design a system for an electronics retail store which sells different brands of electronic items like TV, Fridge, Oven, Music System of different brands and styles. 2. You develop a menu driven system which looks like as given below: s. Sell g. Generate Bill c. Cancel the sale r. … | |
#include<stdio.h> #include<stdlib.h> struct node { int data; struct node *next; }*head; void append(int num) { struct node *temp,*right; temp= (struct node *)malloc(sizeof(struct node)); temp->data=num; right=(struct node *)head; while(right->next != NULL) right=right->next; right->next =temp; right=temp; right->next=NULL; } void add( int num ) { struct node *temp; temp=(struct node *)malloc(sizeof(struct node)); temp->data=num; … | |
I have a Health based .Net (C#) project that needs to import a huge chunk of medical records from an old database that were used in a different application. The database has been successfully migrated to the version compatible with our application. The problem is the contents in one of … | |
[CODE]/*This program is going infinite.PLS help*/ #include<stdio.h> #include<conio.h> void main() { int a,b,c,d,e,f,flag=0; printf("Enter first date"); scanf("%d%d%d",&a,&b,&c); printf("Enter second date"); scanf("%d%d%d",&d,&e,&f); const int days[13]={0,31,28,31,30,31,30,31,31,30,31,30,31}; while(c!=f||b!=e||a!=d) { a++; if((b==4)||(b==6)||(b==9)||(b==11)) f=30; else if(b==2) { if(d%4==0) f=29; else f=28; } else f=31; if(a>f) { b++; a=1; } if(b==13) { c++; b=1; } flag++; … | |
I am trying to add an int to a Multi-dimensional char Array. After reading the link below I would think I can use sprintf. If I can't use sprintf what is another way I can do this? http://www.cplusplus.com/reference/cstdio/sprintf/ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> int main(int argc, char … | |
#include <stdio.h> #include <stdlib.h> int Client_Records(); int outstanding_balances(); int total_company_expenses(); int profit_loss(); void file_guard(); void file_sentinel(); struct records { char client_first_name[30]; char client_last_name[30]; char street_adress[20]; int phone_number; char email_adress[20]; char client_security_package[20]; int annual_package_fee; int payment_made; int annual_vehicle_servicing_expences; int employee_pay; int lot_rental_fees; int utility_bill_payments; int total_expenses; int total_company_earnings; int loss; int … | |
#include <stdio.h> #include <stdlib.h> int Client_Records(); int outstanding_balances(); int total_company_expenses(); int profit_loss(); void file_guard(); void file_sentinel(); struct records { char client_first_name[30]; char client_last_name[30]; char street_adress[20]; int phone_number; char email_adress[20]; char client_security_package[20]; int annual_package_fee; int payment_made; int annual_vehicle_servicing_expences; int employee_pay; int lot_rental_fees; int utility_bill_payments; int total_expenses; int total_company_earnings; int loss; int … | |
I have a Health based .Net (C#) project that needs to import a huge chunk of medical records from an old database that were used in a different application. The database has been successfully migrated to the version compatible with our application. The problem is the contents in one of … | |
Hello, I have been struggling with this project for several days. This is all about doubly Linked List and I have to add reverse section with given code in project. So far it was doing good. I learned a lot from this but the only thing I had issue is … | |
Good Morning, For the last few weeks I've been searching HIGH AND LOW. All forms, dozens of tabs open, and bought about 200 bucks in books. My goal is to learn the windows win32 API and I'm hitting brick walls everywhere I look. So far, I've learned that findwindow (or … | |
#include <iostream> #include <iomanip> #include <stack> #include <queue> #include <vector> #include <fstream> using namespace std; class graph { public: graph(); graph(int); //graph(int, int); void setEdge(int src, int dst); void printGraph();//print graph void bfs(int);//Breadth First Search void dfs(int);//Depth First Search void bfsSpan(int);//Breadth First Search Spanning Tree void dfsSpan(int);//DepthFirt Search Spanning Tree … | |
the last array array 3 is not giving me the desired output. i see no logic errors therefore i do not know why i am getting the wrong output. #include<stdio.h> int arr1[5]={55,145,950,25,500}; int arr2[5]={44,58,98,25,62}; int arr3[5],array1,array2,array3; int i=0,j=0,k=0; for(i=0;i<5;i++){ array1=arr1[i]*2; printf("array 1 doubled is %d . \n",array1); //i++; } for(j=0;j<5;j++){ … | |
How would I go about making this table? ID Type Value X int 4 Y int 4 Z float 0 This is the only way I can think of but I don't think this will work. int main(int argc, char *argv[]) { char *strings_line1[3] = {"ID", "TYPE", "Value"}; char *strings_line2[3] … | |
Ladies and Gentlemen Coders, I'm working with the code below: int GetDrives(void) { wchar_t LogicalDrives[MAX_PATH] = {0}; DWORD r = GetLogicalDriveStringsW(MAX_PATH, LogicalDrives); if ( r == 0 ) { printf("Failed to get drive names. %ld", GetLastError()); return 1; } int NumDriveCount = 0; if ( r > 0 && r … | |
A C/MPI program that is executed using two processes. Process 0 hold a 4 × 4 array A that contains the floating-point values shown below. 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 A[4][4] 9.0 10.0 11.0 12.0 13.0 14.0 15.0 16.0 What is the ordered sequence of the values … | |
after writing a c program and running it,it shows that fatal error:abort(programcollect2).......i have correctly installed codeblocksmingw version......but not compiling | |
Hello, Is there any limitation for the length of array variables in C++? Can I specify the length as wanted or is there any limitation for the array length? What should be the array length, if the length is not known. wchar_t commandString[10000]; Cheers | |
I am using C language to encrypt a text file and decrypt it by the means of an AES Algorithm. This algorithm can only encrypts characters if they are stated in the format of an unsigned character where a letter A is represented by 0x41. what i am trying to … | |
Hi all, I was wondering how to access individual elements in the below case: char *three=(char*){'2','5','8'}; If the assignment were like this: char *three="258"; it can be accessed with three[0],three[1].....etc. How to access in the first case? | |
Hello , I want to ask why I am not receiving the same result using either the `if` with `break` inside the while loop ,either the `while( x!=X && y!= Y )`. #include <stdio.h> #include <stdlib.h> int sol( int X, int Y ) { int x = 0, y = … | |
One of the questions given to us for the lab exam was to generate the first 10 armstrong numbers. I could generate upto 5 numbers correctly..the rest are wrong. [code] #include<stdio.h> #include<conio.h> void main() { int n=1,a,b,i=1,r; clrscr(); while(i<=10) { a=0; b=n; do { r=b%10; a=a+r*r*r; b=b/10; }while(b>0); if(a==n) { … | |
Just started learning MPI and all, need a little help with it though. int main( int argc, char *argv[] ) { int rank, n; MPI_Init( &argc, &argv ); MPI_Comm_size( MPI_COMM_WORLD, &n ); MPI_Comm_rank( MPI_COMM_WORLD, &rank ); int a = rank; int b = 0; int C[n], D[n]; for ( int … | |
https://www.daniweb.com/community/contribute# #include <stdio.h> #include <iostream> int main(int argc, char*argv[]) { int my2d[5][4] ={ { 36, 14, 41, 24}, { 47, 47, 49, 15}, { 40, 23, 29, 49}, { 17, 23, 7, 7}, { 48, 43, 35, 12} }; int result = 0; // avg int avg() float sum=5.4; for(i … | |
HI, i'd like to do a simple calculator in c. i write this program but all the results about subtraction ( SOTTRAZIONE) are not correct. can you told me why? thanks you so much `Inline Code Example Here` case 2: printf ( "the subtraction of these n numbers is : … | |
I am creating multiple C++ DLLs which have a C wrapper around them for use by an external application. I wanted to have a single error handling library that each DLL has access to. If I created the error library as a static library and then include it in the … | |
I having a problem which i cannot compare the deck 1 and deck 2 anyone can help me? #include <stdio.h> #include <stdlib.h> #include <time.h> #include <stdbool.h> // #include the std boolean library #define CARDS 52 #define DRAW 104 //The program will first open Deck 1 then Deck 2, after Deck … | |
Following is a matrix multiplication code written in MPI (Message Passing Interface) which could be run on CPU cluster for parallel processing. This has been successfully tested with two square matrices, each of the size 1500*1500. | |
hii, it may b very simple or very basic thing but iam confused in this case...any one can explain usage of single & double quotes in **echo** statement <?php $x = "test"; echo '$x';//produces $x as a output echo "$x"; //produces test as a output ?> | |
I have problems with the following program which is long to post at once so I will explain what are the problems step by step. 1. Define two structs that represents books and a bookstore as following: typedef struct { char id[14]; char title[16]; int availableNumOfBooksWithSameTitle; }BOOK; typedef struct { … | |
Write a program that will print all highly prime numbers from the input interval <a,b>. Prime number is highly prime if deletion of every digit from right is a prime. Example: 239 is highly prime because 239,23,2 are primes. Could someone point out what are logic errors in the following … | |
hello friends sorry for posting this basic question here but i can't figure it out why my variable "tasse" is getting 8 or (the value of variabale i) in this code below. #include <stdio.h> int main(){ int leght = 15; int tasse =0; int random; int array[15]={1,5,4,7,8,5,1,0,9,7,0,0,5,4,10}; int i,j; for(i=0; … | |
Hello, I am having a bit of an issue with my networking addition to my game engine. The engine uses SDL to provide an event-driven programming environment. I tried adding networking functionality, but it doesn't seem to work. Here is the relevant code: //includes #if defined(_WIN32) #include <winsock2.h> typedef int … | |
Create doubly linked list that has the following information about **books**: **book_id, book_name, author_id, book_price**. Sort list in ascending order by **book_price** using bubble sort algorithm. Delete all books with the smallest and the largest price. How to modify the following program such that the sorting is done using bubble … | |
Hello friends i just have one question i want to make my own android OS customized version or even one day make entire own OS, so i wanted to know for the android OS i must learn JAVA ? or c/++ ?? | |
So my next problem is what mac is right and reliable for me? I will be using my mac for: - Writing word/pages docs - Programming in C++ , Objective-c , Java and more - Game development - Powerpoint/keynote presentations - A little bit of PhotoShop - Music and personal … | |
Hi , Below is the code for printing even/odd numbers alternatively.But some how i am not able to achieve the result. I have seen a version with while loop http://www.bogotobogo.com/cplusplus/quiz_multithreading.php working perfect. But i would like to use one thread for printing one value instead of same thread running in … | |
My understanding of code blocks is that it uses gcc. So I am curious why gcc allows you to have a function called itoa, but code blocks does not let you have a function called itoa. Does anyone know? |
The End.